From: Paul Dietz
Subject: Is there a way to determine if a symbol is the name of a type?
Date: 
Message-ID: <3D47FCC6.8839DBEF@motorola.com>
Is there an easy way in CL to determine if a symbol names a type?

	Paul

From: Barry Margolin
Subject: Re: Is there a way to determine if a symbol is the name of a type?
Date: 
Message-ID: <rDT19.5$Xo6.615@paloalto-snr1.gtei.net>
In article <·················@motorola.com>,
Paul Dietz  <············@motorola.com> wrote:
>Is there an easy way in CL to determine if a symbol names a type?

Just a kludgey way: Use it as an argument to TYPEP or SUBTYPEP and catch
the error.

(defun is-type-p (type)
  (null (nth-value 1 (ignore-errors (typep nil type)))))

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Paul Dietz
Subject: Re: Is there a way to determine if a symbol is the name of a type?
Date: 
Message-ID: <3D480A08.F7C91F07@motorola.com>
Barry Margolin wrote:

> >Is there an easy way in CL to determine if a symbol names a type?
> 
> Just a kludgey way: Use it as an argument to TYPEP or SUBTYPEP and catch
> the error.
> 
> (defun is-type-p (type)
>   (null (nth-value 1 (ignore-errors (typep nil type)))))


That's not standard compliant

(from TYPEP): "The consequences are undefined if the type-specifier
    is not a type specifier."

And SUBTYPEP has no standard exceptional situations.

	Paul
From: Joel Ray Holveck
Subject: Re: Is there a way to determine if a symbol is the name of a type?
Date: 
Message-ID: <y7celdjqdup.fsf@sindri.juniper.net>
> Is there an easy way in CL to determine if a symbol names a type?

I've generally used
  (subtypep candidate t)

Cheers,
joelh
From: Paul F. Dietz
Subject: Re: Is there a way to determine if a symbol is the name of a type?
Date: 
Message-ID: <3D4927B1.A38FF76D@dls.net>
Joel Ray Holveck wrote:
> 
> > Is there an easy way in CL to determine if a symbol names a type?
> 
> I've generally used
>   (subtypep candidate t)

The standard specifies that the first two arguments to subtypep
are type specifiers.  Since it doesn't say what must happen if
they aren't, the behavior of subtypep if candidate is not a type
specifier is undefined (see section 1.4.4.3).

	Paul