@yogthos tbh infix notation is not that hard to define and understand.

Julia and both have pretty complete macros (i think Nim too, only glanced it?)

And notation-to-tree seems pretty obvious typically..

for el in lst: ...

(for (in el lst) ....)

I mean, `in` can be seen as infix operator so `for` could still be like a macro that breaks up that (in el lst) for meaning.

"No operator" can also be an operator. With `()` surrounded after it is call-as-function and with `[]` access as array.

@jasper for me, the main advantage of s-exp notation is that you can use the same language you're already using to transform itself.

When you have separate syntax for logic and data, then you need an additional metalanguage to manipulate the AST that will have its own rules and quirks.

So it largely comes down to having to keep less stuff in your head.

@yogthos i forgot how Julia did it.. something like `(a + b * $c)` produces an expression-object. $c is another value entering into this object. a and b are just the symbols in there, not via variables. Can also do $(some_function(..))

I mean, it doesn't seem that complicated to me.. Tbh i also forgot how the Common Lisp one went... right it used the `(...) and ,(comma) to quickly make trees.

Sign in to participate in the conversation
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!