Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.10.0
-
None
Description
THRIFT-3834 added support for namespaces to the Erlang code generator. However, that support uses a . between the namespace name and the type name. This is inconvenient because, although . is a valid character in an Erlang atom, atoms that contain . must be quoted. This means that a struct named MyStruct in the namespace NS will cause a record named 'NS.MyStruct' to be generated. Here are the rules for naming atoms in Erlang:
Atoms begin with a lower-case letter, and may contain alphanumeric characters, underscores (_) or at-signs (@). Alternatively atoms can be specified by enclosing them in single quotes ('), necessary when they start with an uppercase character or contain characters other than underscores and at-signs.
I propose that if an Erlang namespace ends in a _ that no . be added between the namespace and the struct name when creating the record. This will preserve the current behavior unless the namespace ends is a _, but allow users to override the normal behavior by adding an explicit _ to the end of their namespace declarations.
Attachments
Issue Links
- links to