[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#56875: 29.0.50; [PATCH] Add thread-as macro
From: |
Richard Stallman |
Subject: |
bug#56875: 29.0.50; [PATCH] Add thread-as macro |
Date: |
Tue, 02 Aug 2022 23:47:08 -0400 |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> + (thread-as x
> + 4
> + (- 10 x)
> + (/ x 2))
I propose a different syntax which is more Lispy than thread-as, and
more self-evident:
(let-successive ((x 4
(- 10 x)))
(/ x 2))
A Lisper can guess what it means, without having read a description.
It lends itself to a generalization where there is more than
one bound variable, each of which can have several values:
(let-successive ((x 4
(- 10 x))
(y 6
(- 12 y)))
(* x y))
=> 36
The values after the first can refer to all of the variables,
since all of them are already bound (to the previous values)
at that point.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)