Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Sanity Check

Name: Anonymous 2009-09-25 19:16

Bad idea?
(defmacro letret (return-binding bindings &body body)
  `(let ,(cons return-binding bindings)
     ,@body
     ,(first return-binding)))

(defmacro letret* (return-binding bindings &body body)
  `(let* ,(cons return-binding bindings)
     ,@body
     ,(first return-binding)))

Name: Anonymous 2009-09-26 23:23

>>8
it does seem limited, since you can only return the first binding, which may not always be possible.
OP here, yeah, that's technically a limitation. The idea was to rejigger the case where you have a long let operating on some data, and then just a variable name at the end to return it. It bugs me for some reason. I figure: why not make the intent explicit up front?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List