tomhrr / dale

Lisp-flavoured C
BSD 3-Clause "New" or "Revised" License
1.02k stars 48 forks source link

Add multiple-value mfor #173

Open porky11 opened 7 years ago

porky11 commented 7 years ago

Another, probably more useful way to extend mfor (#125 ), would be accepting multiple values. This would allow something like this:

(mfor (is-dir move-dir) ((is-left right)
                         (is-right left)
                         (is-down up)
                         (is-up down))
  (if (is-dir obj)
    (move move-dir)))

Stanza seems to have it already (see http://lbstanza.org/news.html, search for #for, the name of the macro)