14 ms·
Pardon me lisping, but I just read your code as pseudo linearization of trees... (cons a (cons b (cons c (cons d . nil)))) (li
by agumonkey 11y ago
Pardon me lisping, but I just read your code as
pseudo linearization of trees...
(cons a
(cons b
(cons c
(cons d . nil))))
(list
a
b
c
d)
a,... being condition/reaction pairs.
- TheLoneWolfling 11y agoEffectively. It's one of the reasons why I wish more languages had a generalized switch statement (i.e. one that accepted arbitrary code as conditions, not just constants compared to a single value), preferably with a way to (explicitly, preferably) code a fall-through. It means that you cannot necessarily translate it into a jump table, true. But it means that you can write code much more concisely, on the flip side. And it remains slightly readable.