3 ms·
Eh, yes and no. Python at least has `elif` statements. When execution control depends on the order of nested arguments, I find "c" style to really enhance the
by phillmv 11y ago
Eh, yes and no. Python at least has `elif` statements.
When execution control depends on the order of nested arguments, I find "c" style to really enhance the following contrived example, even with rainbow parens:
(if true
(whatever this is an (example
that is (kind of hard)
(-> to
(read %))))
(this is an ELSE but hard to figure out))
- danneu 11y agoYour example arbitrarily indents and new-lines. If that's what's on the table, then nothing is really going to help you. if (x > 100) { console .log('hello') } else { console.log ('world')} When it comes to if/else and if you indent with some sanity, then lisp is like Python: if the 'else' branch is too hard to spot or if you forget the context by the time you reach the 'else', then your 'if' branch is simply too many lines long. Or you should flip the condition so that the short branch comes first. Meanwhile, I can't even write your lisp example as-is in any of the editors I tried it in.
- aidenn0 11y agoLisp, has cond which is analagous to Python's elif Also you have your indentation wrong; (this is an ELSE but hard to figur eout) should be one column to the left, which makes it significantly more readable.
- 59nadir 11y agoIt's hard if you indent wrong. Also: http://imgur.com/FnXXOXJ http://imgur.com/FnXXOXJ Tell me the above picture is something people have problems understanding the structure of.