-
Notifications
You must be signed in to change notification settings - Fork 2k
Indentation while defining function arguments #1355
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
Comments
I think Jeremy is pretty set against code like
Semantic indentation for logical structures is one thing; for grouping function arguments, it's another. Mind you, it's certainly weird that a comma does that... but it's not clear to me (or the compiler) what you intended the indentation to do. |
What about
? |
Right. As I said:
is eminently sensible, unless we want to completely rethink how implicit parentheses work. |
I agree with 'if' example. There is no way to know it the fn '3' is an argument of fn '2' or in if clausule. But my question was if there is possibility of omitting the comma when the compiler already knows that we are defining arguments as in example:
Here, if I omitt the comma the whole expression won't be ambiguous for the compiler because I knows that we are already defining arguments for fn '1'. Currently ommiting comma results into adding fn '3' as an argument for fn '1' instead of fn '2' |
Yep, Trevor's got this one right -- this is a road we really don't want to be going down. The only meaningful significant indentation/call is this one:
... because it's just sugar for:
Other types of indentation-means-arguments have been proposed before. |
Compiles into
Is there any chance that the "," from the third example could be omitted as it is in the first example and still return expected result based on the indentation?
The text was updated successfully, but these errors were encountered: