This may not be a bug so much as an incorrect expectation on my part, but I couldn't find it reported otherwise.
Tested with Erlang/OTP 19, Elixir 1.3.4 and 1.4.0
I would expect "foo_bar" or some variation on that. I know this isn't precisely what Macro.underscore/1 advertises to do, but I'm trying to use it to turn a not-quite-arbitrary string (may represent, e.g., a function name in another language) into a valid Elixir function name. Regardless, the output "fo_o__bar" seems odd.
The text was updated successfully, but these errors were encountered:
I created my version of &Macro.underscore/1 with tests for both implementations: MyMacroUnderscore.
Test it and let me know what do you think about it. Any tips are welcome! 😄 Note: I'm also changing ASCII whitespace characters to _ with really easy method guards.
If you are interested in my version of this method then I can create PR here.
The screaming snake case was keeping its original format after being
camelized. As mentioned in issue elixir-lang#5627. This change allows it to behave
like the all lower snake case when camelized.
Amos King @adkron <firstname.lastname@example.org>