struct/enum fields names #1748
Replies: 3 comments 3 replies
-
This is something I do often in Elm. Being able to use underscores in names is very useful to make the namespaces of custom types clear. However, would be even better being able to write this like Rust e.g. |
Beta Was this translation helpful? Give feedback.
-
@sporto of course, rust-like would be ideal, but i guess it might require more complex rework on the compiler |
Beta Was this translation helpful? Give feedback.
-
It is likely too late in the development in the language to make a change as large as making custom type constructors qualified, so we would need to come up with an appealling backwards compatible design or one with a very good upgrade path. We could permit underscores in constructor names but we would need to determine how to use these in code generation. We currently convert names to snake case to use in Erlang, we would need to continue to do this but also ensure that no two names clash after conversion. i.e. |
Beta Was this translation helpful? Give feedback.
-
can't mix underscores or other symbols to names, how to define a large protocol ?
imagine a few hundreds of these used on real code to implement a network protocol:
in other langs, u at least can use some symbols on the names
in rust u have multiple alternatives to avoid name clashes, and reduce visual clutter or at least hint where a name ends and another stars
Beta Was this translation helpful? Give feedback.
All reactions