Mark Conrad <nos...@iam.invalid> writes:This is not possible in general in Common Lisp. (There may be
> I really thought there was a way for me to 'escape' from deeply nested
> code within the body of my program, ending the execution of my program
> mid-cycle, so to speak, winding up at toplevel with my program stopped
> dead in its tracks. (as catch and throw can do) - all this by using
> simple CL code like cond, cons, car, cdr, etc.
implementations that allow this, but the ability to do this is not
required.) You *can* escape to top level using a catch and throw, but
your program is *terminated* when you do so. It is not just stopped
dead in its tracks, it is removed from the track altogether.
You can fake it in Common Lisp. The issue is that there is
> My aim was to eventually demonstrate that a lot of those constructsYou can indeed model these constructs with continuations, but since
> could be duplicated in their actions by substituting continuations in
> place of the legitimate constructs like catch, throw, and possibly even
you are faking the continuations, you'll have to fake these as well.
> The suggestions that some have suggested I consider was to use theConsider carefully what you are saying: `I am against using CL
> built-in CL constructs "eval-when" and/or "define-symbol-macro" in
> order to 'force' Paul Graham's old code to work in an ANSI environment.
> I am against that approach on principle,
constructs to make Paul Graham's code work.' Not too many people go
out of their way to
a) make their task more difficult
b) have non-working code as goal
c) elevate these to a `principle'
> because when I want my toplevel non-special variable %cont% to haveI'll try saying this again: DO NOT USE DEFINE-SYMBOL-MACRO!
> a value of 'foo - - then I want it to stay that way until I myself
> change it - - - eval-when does not allow that to happen, my 'foo
> value gets magically messed with in behind-the-scenes manipulation
> by either eval-when or define-symbol-macro, I don't know which one
> (or both) of those constructs does the messing with the toplevel
> value of my variable, but I don't like it.
Remove it. Delete it. It does not do what you think it does, and it
does not do what you want.
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.