3 ms·
there's a hybrid form (sweet-expressions ? i forgot), top-level terms are parens-free eq (mul a a) (pow a 2) defun min (a b) (if (a < b)
by agumonkey 1y ago
there's a hybrid form (sweet-expressions ? i forgot), top-level terms are parens-free
eq (mul a a)
(pow a 2)
defun min (a b)
(if (a < b) a b)
IIRC the hack to support this at read time was minimal, and it made a big impact in terms of "mainstream appeal"
- em-bee 1y agothe elvish shell uses the syntax in the first example: > eq (* 3 3) (math:pow 3 2) ▶ $true (function definitions on the other hand uses smalltalk/ruby style blocks)
- marcosdumay 1y agoIMO, make some syntax element that means "each line indented from this one has one single element, unless indented further". eq : mul a a pow a 2 defun min (a b) : if (< a b) a b That means you can also have haskell-like continuations: seq : eq (mul a a) (pow a 2) eq 4 3