Re:Playing with Syntax
by abritinthebay on Wednesday August 24, 2016 @02:02PM
(#12353950)
Good explaination! Thank you!
That does explain it very well but I'd also argue that a syntax that requires that much explaining probably can't be called "elegant".
Powerful though? Yes. Lips syntax certainly is that.
The quote is a multi-purpose element of the syntax, unlike `[` in Python, which only serves a single purpose (actually, it doubles as an item getter syntax). Whether having a single, more universal construct which you can use in many situations, or having a few more specialized constructs is more elegant is debatable and I think a matter of taste.
The problem with having specialized syntax for this is that it's not extensible. For example, we (I'm a Python programmer, too) had to wait for 3.4 (IIRC) for a very simple feture of `a, b, *c = range(10)`; with a language built on macros you can extend these constructs as much as you wish. For example adding support for destructuring hash-maps (if it's not supported already) shouldn't be a big problem; on the other hand adding a specialized syntax for dict destructuring in Python is impossible within a language.