News for hackers. Stuff that matters.
Re:Compiling a Lisp to x86-64: Let expressions by sillysaurusx on Thursday October 01, 2020 @04:57PM (#24656080)
(lets a 1 b 2 (+ a b)) is such a nice macro. Everything but the last expression are bindings.
Re:Compiling a Lisp to x86-64: Let expressions by bjoli on Friday October 02, 2020 @04:08PM (#24666548)
What? The let way of variable bindings is standard just about everywhere. Why replace it with something that doesn't visually distinguish binding pairs? To my lispy eyes it is harder to navigate than

    (let ((a 1) (b 2))
      (+ a b))
and harder to implement as a syntax rules macro :)
Re:Compiling a Lisp to x86-64: Let expressions by sillysaurusx on Saturday October 03, 2020 @05:10PM (#24674695)
Free yourself from the shackles of parens. Throw off your bindings and run into the streets. It's worth it.

Arc uses (let a 1 (+ a 2)), and lets is simply the logical progression of that.

Re:Compiling a Lisp to x86-64: Let expressions by bjoli on Monday October 05, 2020 @01:38PM (#24689985)
I have gone the other way. when I first learned macros I spent loads of time trying to make paren-free versions of the standard scheme forms, and now I can't even be assed to do the racketism of surrounding my binding clauses with [].

The parens of let lets me easily distinguish the binding clauses, and lets me navigate it a lot easier in Emacs. The lets macro seems like the opposite of that. Every odd thing except the last element is an identifier and every even thing is that identifiers value.

Re:Compiling a Lisp to x86-64: Let expressions by TylerE on Thursday October 01, 2020 @08:59PM (#24657748)
Why is it nicer than (+ 1 2).

What is gained from an extra layer of indirection?

Re:Compiling a Lisp to x86-64: Let expressions by sillysaurusx on Thursday October 01, 2020 @09:27PM (#24657869)
Fewer parens. It was just a trivial example to illustrate the macro.

(lets (a b) (list 1 2) c (+ a 3) (d e f) (some-func a b c) (* d e f))

It destructures automatically. The equivalent traditional macro might look like

(destructuring-bind* [[(a b) (list 1 2)] [c (+ a 3)] [(d e f) (some-func a b c)]] (* d e f))

which is unreadable. And yeah, normally it's indented properly and yada-yada, and people use editor plugins like paredit to make it not such a pain to type, but still. It adds up.