-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Function scope, indentation and if-else create very confusing code #2734
Comments
The else is far too much indented (13) |
This is another occurrence of #1275. |
uh? |
Sorry about the duplicate! I thought this was if-else specific. You mean that it should be
Perhaps that is the correct syntax. I've no experience with coffee yet. |
what doesn't make sense is to indent by 13 when it should be by 4. The compiler shouldn't let you do that, but that result seems expectable when you know coffee is a whitespace-sensitive language |
I wonder if the code example is actually rendering correctly on my end. I intended the But atleast we agree that it should be an error. |
They're not whitespace-sensitive languages. Their blocks do not depend on the indentation. |
At lest Haskell is. It has some "weird" rules about indentation, but they are very consistent IMO. |
My bad. Ocaml had the indentation-based syntax only as an extension. Haskell blocks certainly are denoted by indentation |
Consider the following functions
Either they should be the same, or there should be an error for the latter. Now, what happens is:
and
I would hazard to say that the latter is quite confusing.
using version 1.5.0
The text was updated successfully, but these errors were encountered: