Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top