Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Tue, 13 May 2003 21:00:01 GMT
Local: Tues, May 13 2003 5:00 pm
Subject: Giving Up! (was "UNWIND_PROTECT in Scheme")
(Willaim D. Clinger observed in another thread):
> Recall that this conversation started when someone used In my naive newbie opinion, I agree wholeheartedly, but what the heck, > call/cc as an example of excessive expressive power. Kent > didn't accept that argument. He tried to argue instead that > call/cc and dynamic-wind have insufficient expressive power. > That's nonsense: the theorists believe that, when combined > with side effects and the rest of Scheme, call/cc is powerful > enough to implement every deterministic sequential control > structure that has ever been proposed. newbies opinions like mine count for less than nothing, right. I am actually such a new newbie, that I don't even know the difference Just repeating what I read, please don't pounce on me. ...but all that esotoric stuff is beyond my comprehension anyhow, I am "into" CL strictly for recreation. BTW, whatever _did_ happen to the days when computing was fun, and Anyhow, onwards and upwards to my Big Newbie Problem, the one that Kent M. Pitman, a CL expert, made some sort of statement to me to the Forgive me Mr. Pitman if I interpreted this all wrong. Anyhow, in my newbie zeal, I am trying to do with Graham's CL catch, throw, tag, return, return-from, unwind-protect, toplevel, go, Now to my specific newbie example, and the immense problems I ran into. To make this code as portable as possible in implementations such as This created the huge problem (huge to me) of my not being able to Now I have seen it stated in CL literature that any CL construct can be ...indeed, it has to be, inside of the CL implementation itself, before I don't know if this is CL "propaganda", or if it indeed is correct. But I digress, back to my Big Problem. Remembering that all my code is enclosed in an all-encompassing "let"... (let ()... I have pretty well given up on this, I can't see how to escape to Anyhow, I am just starting to use Paul Graham's six macros. The two most important of his six macros, IMO, are "=bind" and FWIW, this code should work across all ANSI conforming applications. Just remember to compile it at least two-three times after loading it Once loaded and compiled, type (demo) to run the code, Copy and paste everything here to your CL, only if you are inclined to (defvar %cont%) ;; All the code is "within the body" of the 'let' form below; (let (( %cont% #'(lambda (&rest args) %cont% ;; Start of Paul Graham's six macros, taken ;; ************************************* (defmacro =defun (name parms &body body) (defmacro =bind (parms expr &body body) (defmacro =values (&rest retvals) (defmacro =funcall (fn &rest args) (defmacro =apply (fn &rest args) (defvar h) (let ((n 12000000)) (defun elsewhere () (defun demo () You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||