Re:A different take on S-expressions
by agumonkey on Wednesday June 18, 2025 @05:14PM
(#44313332)
there's a hybrid form (sweet-expressions ? i forgot), top-level terms are parens-free
IIRC the hack to support this at read time was minimal, and it made a big impact in terms of "mainstream appeal"
[ Parent
| on HN ]
the 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)
Re:A different take on S-expressions
by marcosdumay on Wednesday June 18, 2025 @09:41PM
(#44314713)
IMO, 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