Sorry, I'm against the proposal.
I think it does not contribute much to readability but is more error prone, will probably have worst error messages when things go wrong and will consume too much time and effort to implement correctly, time and effort that can be spent doing more important tasks.
[ funarg]
[ funarg]
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I feel inclined to disagree with this proposal, although I must say that I don't have must experience with languages where commas are optional or non-existant.
I've reduced the number of infix operators I use, I almost never expose functions, and I force myself to make my code look nice by rearranging code and indenting consistently etc even if it increases the code size.
I think that having mandatory commas fits in nicely with the general philosophy in Elm of adding some verbosity and making things slightly more explicit in order to end up with code that is simpler, shorter, sweeter, way more maintainable and less error prone.
My goodness, yes.
--
Here is TodoMVC with and without the proposal:
if those record definitions didn't need to be indented so much
[ id "new-todo" placeholder "What needs to be done?"
autofocus True
value task
name "newTodo"
on "input" targetValue (Signal.send updates << UpdateField)
onEnter (Signal.send updates Add)
]
[
id "new-todo"
placeholder "What needs to be done?"
autofocus True
value task
name "newTodo"
on "input" targetValue (Signal.send updates << UpdateField)
onEnter (Signal.send updates Add)
]
Yeah, that's just a personal preference because it's easier to rearrange things when every line starts with whitespace. The proposed syntax supports doing it either way.
--
One may argue it's just a small exception, but for a language that's already challenging to grok, adding more nuances to the wrong way to go.
M
As I understand the proposal for elm, this would create some situations where indentation becomes important. I'm really concerned about this. Indentation should either always be important or not important at all. I'm worried about this middle case, where it's sometimes important.
f =
let foo = 1
bar = 2
in
foo
indentation doesn't match
3| bar = 2
^
I am looking for one of the following things:
reserved word `in`
whitespace