2 ms·
It looks like this in my personal Lisp dialect, with no new macros: (match (foo) (#no (log "foo failed") #no) (x (match (bar x) (#no
by abecedarius 10y ago
It looks like this in my personal Lisp dialect, with no new macros:
(match (foo)
(#no (log "foo failed") #no)
(x (match (bar x)
(#no (log "bar failed") #no)
(y (match (goo x y)
(#no (log "goo failed") #no)
(z (qux x y z)
(log "it worked")
#yes))))))
I imagine any language with a match macro, like Racket, could look similar. Using monads or exceptions ought to look nicer, but I'd kind of rather not pull out the big guns.