thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King, III (JIRA)" <>
Subject [jira] [Closed] (THRIFT-4269) Don't append '.' to Erlang namespace if it ends in '_'.
Date Thu, 14 Dec 2017 13:55:10 GMT


James E. King, III closed THRIFT-4269.

> Don't append '.' to Erlang namespace if it ends in '_'.
> -------------------------------------------------------
>                 Key: THRIFT-4269
>                 URL:
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Erlang - Compiler
>    Affects Versions: 0.10.0
>            Reporter: David Hull
>            Assignee: David Hull
>            Priority: Minor
>             Fix For: 0.11.0
> 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:
> bq. 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.

This message was sent by Atlassian JIRA

View raw message