문제

What are the naming conventions in Rascal? It seems that modules, but not intermediate paths, tends to be upper case, also variable names. Does it make a difference? What is the convention and the rationale behind it?

도움이 되었습니까?

해결책

We are working towards the convention that:

  • identifiers for functions, variable names, constructors, fields names of tuples and constructors, start with lowercase and continue with camelCase.
  • user-defined types such as, alias, data, syntax, lexical non-terminals, start with uppercase and continue with CamelCase.

The rationale is that in Rascal syntax definitions we currently need a syntactic difference between type names and label names to prevent ambiguity, and we chose to have one with uppercase and the other with lowercase first letters. The above convention continues in that vain for the rest of the language for the sake of consistency, but is yet to be formalized.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top