Path: csiph.com!news.nrbbs.org!border-2.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 05 Sep 2026 02:01:32 +0000 From: steve g Newsgroups: comp.lang.lisp Subject: Re: Continuations via macros References: <110a9pp$ckmk$6@dont-email.me> <115i4sf$uekh$1@dont-email.me> <874igxov3y.fsf@nightsong.com> <115n0v3$2h2oe$1@dont-email.me> <87zeyoo77t.fsf@nightsong.com> <116h0dv$2m9e2$1@dont-email.me> <116hd1l$2qooi$1@dont-email.me> <116hgb5$2s4uh$1@dont-email.me> <87tsojm54k.fsf@nightsong.com> <116jmt4$3jrlq$1@dont-email.me> <87fr01mplp.fsf@nightsong.com> <87tsogiuxx.fsf@safunu.org> <877blcmk4z.fsf@nightsong.com> <116pidp$3n6fk$1@paganini.bofh.team> <8733vzmixj.fsf@nightsong.com> Date: Fri, 04 Sep 2026 22:01:31 -0400 Message-ID: <87o6eczcas.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:kHSLFc0PnOL5n4q9pyTTDqBW4R0= MIME-Version: 1.0 Content-Type: text/plain Lines: 35 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-jS8+ak+WgxUJN4wyOPDJ6N5nN6bhmQz0XVqhf/qzmUD9j8evepAHRzfEPBmqMtFrwB9svwtRMzrW5Yq!JcMmGoqXnwW2Wz9UjxDRVyFYz1Ro/L0EVzEzwdVBSLRmEJI= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: csiph.com comp.lang.lisp:61626 Stefan Monnier writes: > AFAIK it's impossible to implement support for `call/cc` via macros in > Common Lisp *if* you want the affected code to be able to transparently > call arbitrary "external" functions like (say) `mapcar`. > > OTOH, you can definitely implement a Common Lisp macro that takes as > argument code written in a DSL which happens to be a language that looks > exactly like Common Lisp except it includes a `call/cc` primitive > (and in which you can (re)implement `mapcar`). > >> There is some sentiment[1] in the Scheme world that mandating full >> continuations in Scheme was a mistake and that it would have been >> preferable to stop with "delimited" or "one-shot" continuations. Those >> are maybe closer to catch/throw than to coroutines. I don't know if >> those can be done with CL macros but it seems more plausible. > > AFAIK they bump into the same problem as `call/cc` w.r.t implementing > them as macros. I have always wondered if using the environment would suffice as a inter-procedural reality. common-lisp is not very informative about this. (defmacro that (&env environment) (push 'this-is-true environment) (this)) (defmacro this (&env environmenr) (how to you push or pop environment).. I suppose you could always use &aux ?