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

TAILPROG

Name: Anonymous 2010-01-31 11:01


(defmacro tailprog (let-bindings pseudo-funcs &rest forms)
  (let (argtags-forms macrolet-elems)
    (dolist (pfunc pseudo-funcs)
      (destructuring-bind (name vars &rest forms) pfunc
        (push `(label ,name ,@vars) argtags-forms)
        (push `(return (progn ,@forms)) argtags-forms)
        (push `(,name (&rest args) `(goto ,',name ,@args)) macrolet-elems)))
    `(macrolet (,.(nreverse macrolet-elems))
       (let ,let-bindings
         (argtags nil
           (return (progn ,@forms))
           ,.(nreverse argtags-forms))))))

ALL YOUR TAIL RECURSION R BELONG TO US

Name: Anonymous 2010-02-01 10:01

>>8
It would mean you would have to understand what they meant by "in the tail position." In the loop macro, which is in the tail position? I know how to find out with scheme: I scan a short document.

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