From: Peter Seibel
Subject: Other macros in COMMON-LISP that generate names a la DEFSTRUCT?
Date: 
Message-ID: <m31xi73f20.fsf@javamonkey.com>
Are there any macros defined in the language standard that generate
global names similar to the the way DEFSTRUCT does other than
DEFSTRUCT. I don't mean macros like DEFUN, DEFCLASS, etc. that use
names provided by the macro caller but ones that actually generate a
symbol that was not passed as an argument to the macro and then give
it a global meaning the way (defstruct foo x y) does for MAKE-FOO,
COPY-FOO, FOO-P, FOO-X, and FOO-Y?

-Peter

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

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

From: Rob Warnock
Subject: Re: Other macros in COMMON-LISP that generate names a la DEFSTRUCT?
Date: 
Message-ID: <N_OdndtHGO9gBr3cRVn-hg@speakeasy.net>
Peter Seibel  <·····@javamonkey.com> wrote:
+---------------
| Are there any macros defined in the language standard that generate
| global names similar to the the way DEFSTRUCT does other than
| DEFSTRUCT. I don't mean macros like DEFUN, DEFCLASS, etc. that use
| names provided by the macro caller but ones that actually generate a
| symbol that was not passed as an argument to the macro and then give
| it a global meaning the way (defstruct foo x y) does for MAKE-FOO,
| COPY-FOO, FOO-P, FOO-X, and FOO-Y?
+---------------

DEFINE-CONDITION, for sure.

And maybe DEFSETF & DEFINE-SETF-EXPANDER, if you consider the
#'FOO => #'(SETF FOO) transformation to be included in your
criteria (though the naming of the generated setf functions
may not be completely standardized, I'm not sure).


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Barry Margolin
Subject: Re: Other macros in COMMON-LISP that generate names a la DEFSTRUCT?
Date: 
Message-ID: <barmar-01CBC9.09074816082004@comcast.dca.giganews.com>
In article <······················@speakeasy.net>,
 ····@rpw3.org (Rob Warnock) wrote:

> Peter Seibel  <·····@javamonkey.com> wrote:
> +---------------
> | Are there any macros defined in the language standard that generate
> | global names similar to the the way DEFSTRUCT does other than
> | DEFSTRUCT. I don't mean macros like DEFUN, DEFCLASS, etc. that use
> | names provided by the macro caller but ones that actually generate a
> | symbol that was not passed as an argument to the macro and then give
> | it a global meaning the way (defstruct foo x y) does for MAKE-FOO,
> | COPY-FOO, FOO-P, FOO-X, and FOO-Y?
> +---------------
> 
> DEFINE-CONDITION, for sure.

What names does it create?

> 
> And maybe DEFSETF & DEFINE-SETF-EXPANDER, if you consider the
> #'FOO => #'(SETF FOO) transformation to be included in your
> criteria (though the naming of the generated setf functions
> may not be completely standardized, I'm not sure).

I think the gist of his question is whether there are any other macros 
that intern new symbols to name the operators they define.  I think all 
the macros you mention take the symbol as a parameter, rather than 
generating the names themselves.

DEFSTRUCT's behavior is a legacy of its Maclisp heritage.  Maclisp 
didn't have packages, so the problem of names being interned in the 
wrong package didn't exist.  The functions that were created in for Lisp 
Machine Lisp or Common Lisp were designed with this in mind, so they 
take the symbols as parameters rather than constructing them on the fly.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Rob Warnock
Subject: Re: Other macros in COMMON-LISP that generate names a la DEFSTRUCT?
Date: 
Message-ID: <-YKdnWV3vfKaQ7TcRVn-tQ@speakeasy.net>
[Sorry for the belated reply. Been having computer troubles...]

Barry Margolin  <······@alum.mit.edu> wrote:
+---------------
| ····@rpw3.org (Rob Warnock) wrote:
| > Peter Seibel  <·····@javamonkey.com> wrote:
| > +---------------
| > | Are there any macros defined in the language standard that generate
| > | global names similar to the the way DEFSTRUCT does other than
| > | DEFSTRUCT. I don't mean macros like DEFUN, DEFCLASS, etc. that use
| > | names provided by the macro caller but ones that actually generate a
| > | symbol that was not passed as an argument to the macro and then give
| > | it a global meaning the way (defstruct foo x y) does for MAKE-FOO,
| > | COPY-FOO, FOO-P, FOO-X, and FOO-Y?
| > +---------------
| > 
| > DEFINE-CONDITION, for sure.
| 
| What names does it create?
...
| I think the gist of his question is whether there are any other macros 
| that intern new symbols to name the operators they define.  I think all 
| the macros you mention take the symbol as a parameter, rather than 
| generating the names themselves.
+---------------

My apologies, you're right. Somehow I misread the part in CLHS "Macro
DEFINE-CONDITION" which said "Accessors are created according to the
same rules as used by DEFCLASS", which I misread as saying "...the same
rules as used by DEFSTRUCT." (Oops!)

"Never mind..."


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607