From: Peter Seibel
Subject: Do any operators in COMMON-LISP use THROW?
Date: 
Message-ID: <m3isquc9qx.fsf@javamonkey.com>
Are there any constructs in standard Common Lisp who are required or
explicitly allowed[1] to return by THROWing? I can't think of any but
I haven't gone over the standard with this question in mind.

-Peter

[1] By "explicitly" I mean to exclude cases where the behavior is
undefined. If the behavior is undefined obviously one acceptable
implementation is:

  (throw 'nasal-output 'daemons)


-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp

From: Steven M. Haflich
Subject: Re: Do any operators in COMMON-LISP use THROW?
Date: 
Message-ID: <3EFA6C2E.8050505@alum.mit.edu>
Peter Seibel wrote:
> Are there any constructs in standard Common Lisp who are required or
> explicitly allowed[1] to return by THROWing? I can't think of any but
> I haven't gone over the standard with this question in mind.
> 
> [1] By "explicitly" I mean to exclude cases where the behavior is
> undefined. If the behavior is undefined obviously one acceptable
> implementation is:
> 
>   (throw 'nasal-output 'daemons)

The obvious example is THROW itself.  Duh,,,

"required" is a difficult term because it requires [sic] proof that
there is no other possible implemenation.  Notwithstanding, consider
whether it would be possible to implement the condition system without
using THROW and CATCHm assuming that RESTARTs are less primitive than
CATCH/THROW.
From: Peter Seibel
Subject: Re: Do any operators in COMMON-LISP use THROW?
Date: 
Message-ID: <m38yrpbalz.fsf@javamonkey.com>
"Steven M. Haflich" <·················@alum.mit.edu> writes:

> Peter Seibel wrote:
> > Are there any constructs in standard Common Lisp who are required or
> > explicitly allowed[1] to return by THROWing? I can't think of any but
> > I haven't gone over the standard with this question in mind.
> > [1] By "explicitly" I mean to exclude cases where the behavior is
> 
> > undefined. If the behavior is undefined obviously one acceptable
> > implementation is:
> >   (throw 'nasal-output 'daemons)
> 
> 
> The obvious example is THROW itself.  Duh,,,

Yeah. Other than *that* one. ;-)

> "required" is a difficult term because it requires [sic] proof that
> there is no other possible implemenation. Notwithstanding, consider
> whether it would be possible to implement the condition system
> without using THROW and CATCHm assuming that RESTARTs are less
> primitive than CATCH/THROW.

Hmmm. Funny you should mention that--I just posted a question about
that very thing the other day. It seems to me that restarts are more
likely to be implemented under the covers with closed over
RETURN-FROMs. Of course you're an implementor and I'm just guessing so
I'd be interested to hear your thoughts about implementation
strategies.

But that was really my point in this question. I was thinking of cases
where it was part of the API--as in "this function will return thus on
such a value except in the following situation when it will THROW this
other value to such and such a tag." If some other thing happens to
use THROW under the covers then that's none of my business.

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Kent M Pitman
Subject: Re: Do any operators in COMMON-LISP use THROW?
Date: 
Message-ID: <sfw7k78oklc.fsf@shell01.TheWorld.com>
Peter Seibel <·····@javamonkey.com> writes:

> "Steven M. Haflich" <·················@alum.mit.edu> writes:
> 
> > Peter Seibel wrote:
> > > Are there any constructs in standard Common Lisp who are required or
> > > explicitly allowed[1] to return by THROWing? I can't think of any but
> > > I haven't gone over the standard with this question in mind.
> > > [1] By "explicitly" I mean to exclude cases where the behavior is
> > 
> > > undefined. If the behavior is undefined obviously one acceptable
> > > implementation is:
> > >   (throw 'nasal-output 'daemons)
> > 
> > 
> > The obvious example is THROW itself.  Duh,,,
> 
> Yeah. Other than *that* one. ;-)

Well, at a certain meta-level, CATCH kind of uses THROW--as a justification
for its own existence.  Does that count? ;)