New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elixir 1.7.* syntax backwards incompatability with 1.6* and earlier #8386
Comments
It is not a breaking change because the previous behaviour was never expected nor specified. do/end blocks should either have expressions OR clauses but never both. I will be glad to document this behaviour more clearly to avoid such confusion in the future but, in this case, I am afraid you were relying on accidental behaviour. |
Well that sucks, I'm not sure how else I can make that so easily succinct and readable then... Might have to use a verbose word or change to a parsed string horror... >.> |
Isn't it still backwards incompatible though as this was entirely useable syntax within macor's? Plus there is no syntax spec for Elixir as it is (which would have prevented such a mis-parsing to exist in the first place) thus whatever the compiler accepts into a macro is by all rights valid since we have no defined syntax spec? |
I don't think having a spec would have prevented the bug, because the behaviour was always clear to me when implementing this feature set, but the bug was still unnoticed for large periods of time. Maybe it would have been caught earlier though. That said, I definitely wouldn't want all parser bugs to be considered features. Over the years we have improved how we spec our syntax, including the document changed above, so I would continue treading this path. My suggestion here would be to replace those operators by any of our custom operators. |
There are cases where that would fail as a direct replacement, necessitating parenthesis to disambiguate. |
Precheck
Initially reported at: https://elixirforum.com/t/elixir-1-7-4-backwards-incompatibility/17917/2
Environment
Current behavior
Minimal code for iex:
Complete session in 1.7.4 (same in 1.7.0):
Expected behavior
Complete session in 1.6.6:
Thus this is a backwards incompatibility without an Elixir 2.* version bump and it has as such broken the library at
https://github.com/OvermindDL1/ex_core.git
in a backwards incompatible way (and in a way in which it cannot emulate again without a syntax overhaul).Backwards incompatible syntax changes should necessitate a major version bump, thus Elixir 2.*
The text was updated successfully, but these errors were encountered: