Fun with Macros: If-Let and When-Let

I haven’t been writing much lately because I’ve been in the process of switching my life over to Linux from OS X. I finally managed to get my blog infrastructure running again, so let’s take a look at some deceptively-tricky Common Lisp macros: when-let and if-let (and their let* counterparts).
Introduction I first heard of the when-let and if-let macros when I learned Clojure a few years ago. They’re used like let to bind values to variables, but if a value is nil then when-let will return nil without running the body, and if-let will execute its alternative branch.
 •  0 comments  •  flag
Share on Twitter
Published on July 09, 2018 09:00
No comments have been added yet.


Steve Losh's Blog

Steve Losh
Steve Losh isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Steve Losh's blog with rss.