From: RG on
In article <m2y6hxqlxi.fsf(a)gmail.com>,
Helmut Eller <eller.helmut(a)gmail.com> wrote:

> * Rainer Joswig [2010-03-12 21:12+0100] writes:
>
> > From the CLHS page for COMPILE:
> >
> > 'if name is a symbol that names a macro, its macro function is updated'
>
> The whole sentence is:
>
> If a non-nil name is given, then the resulting compiled
> function replaces the existing function definition of name and the name is
> returned as the primary value; if name is a symbol that names a macro, its
> macro function is updated and the name is returned as the primary value.
>
> > I would also say that this is clear.
>
> Are you saying that those two clauses are mutually exclusive?

Yes, of course. Why would you doubt it? Function bindings and macro
function bindings for a single symbol are mutually exclusive.

> "update" could also mean "remove the macro binding".

No, it couldn't, because the first clause refers to replacing the
"existing function definition." The only way there can be an "existing
function definition" to replace is if it's a function, not a macro.

It could use a bit of wordsmithing, but the intent is clear.

rg
From: Helmut Eller on
* RG [2010-03-12 22:52+0100] writes:

> In article <m2y6hxqlxi.fsf(a)gmail.com>,
> Helmut Eller <eller.helmut(a)gmail.com> wrote:
>
>> * Rainer Joswig [2010-03-12 21:12+0100] writes:
>>
>> > From the CLHS page for COMPILE:
>> >
>> > 'if name is a symbol that names a macro, its macro function is updated'
>>
>> The whole sentence is:
>>
>> If a non-nil name is given, then the resulting compiled
>> function replaces the existing function definition of name and the name is
>> returned as the primary value; if name is a symbol that names a macro, its
>> macro function is updated and the name is returned as the primary value.
>>
>> > I would also say that this is clear.
>>
>> Are you saying that those two clauses are mutually exclusive?
>
> Yes, of course. Why would you doubt it? Function bindings and macro
> function bindings for a single symbol are mutually exclusive.

OK then. That's all I wanted to know.

>> "update" could also mean "remove the macro binding".
>
> No, it couldn't, because the first clause refers to replacing the
> "existing function definition." The only way there can be an "existing
> function definition" to replace is if it's a function, not a macro.

Well, to be nitpicking: 1) if the symbol has no function definition the
first clause applies 2) all symbols with a macro definition have a
non-nil fdefinition too.

Helmut
From: Rainer Joswig on
In article <rNOSPAMon-EC7A53.13520912032010(a)news.albasani.net>,
RG <rNOSPAMon(a)flownet.com> wrote:

> In article <m2y6hxqlxi.fsf(a)gmail.com>,
> Helmut Eller <eller.helmut(a)gmail.com> wrote:
>
> > * Rainer Joswig [2010-03-12 21:12+0100] writes:
> >
> > > From the CLHS page for COMPILE:
> > >
> > > 'if name is a symbol that names a macro, its macro function is updated'
> >
> > The whole sentence is:
> >
> > If a non-nil name is given, then the resulting compiled
> > function replaces the existing function definition of name and the name is
> > returned as the primary value; if name is a symbol that names a macro, its
> > macro function is updated and the name is returned as the primary value.
> >
> > > I would also say that this is clear.
> >
> > Are you saying that those two clauses are mutually exclusive?
>
> Yes, of course. Why would you doubt it? Function bindings and macro
> function bindings for a single symbol are mutually exclusive.
>
> > "update" could also mean "remove the macro binding".
>
> No, it couldn't, because the first clause refers to replacing the
> "existing function definition." The only way there can be an "existing
> function definition" to replace is if it's a function, not a macro.
>
> It could use a bit of wordsmithing, but the intent is clear.
>
> rg


The purpose is that COMPILE can compile both macros and functions.


Unfortunately it is unclear what it does with METHODS and
GENERIC-FUNCTIONS. If the function is a generic function, does
it also compile all the methods?

What is also unclear to me is this:

(compile 'bar123 (lambda (x) x))

What does it do if BAR123 has no macro and no function definition?
The spec says that an existing function definition will be replaced,
but not that it make it a function definition if there is none.

--
http://lispm.dyndns.org/
From: RG on
In article <m2bpetqjof.fsf(a)gmail.com>,
Helmut Eller <eller.helmut(a)gmail.com> wrote:

> * RG [2010-03-12 22:52+0100] writes:
>
> > In article <m2y6hxqlxi.fsf(a)gmail.com>,
> > Helmut Eller <eller.helmut(a)gmail.com> wrote:
> >
> >> * Rainer Joswig [2010-03-12 21:12+0100] writes:
> >>
> >> > From the CLHS page for COMPILE:
> >> >
> >> > 'if name is a symbol that names a macro, its macro function is updated'
> >>
> >> The whole sentence is:
> >>
> >> If a non-nil name is given, then the resulting compiled
> >> function replaces the existing function definition of name and the name
> >> is
> >> returned as the primary value; if name is a symbol that names a macro,
> >> its
> >> macro function is updated and the name is returned as the primary value.
> >>
> >> > I would also say that this is clear.
> >>
> >> Are you saying that those two clauses are mutually exclusive?
> >
> > Yes, of course. Why would you doubt it? Function bindings and macro
> > function bindings for a single symbol are mutually exclusive.
>
> OK then. That's all I wanted to know.
>
> >> "update" could also mean "remove the macro binding".
> >
> > No, it couldn't, because the first clause refers to replacing the
> > "existing function definition." The only way there can be an "existing
> > function definition" to replace is if it's a function, not a macro.
>
> Well, to be nitpicking: 1) if the symbol has no function definition the
> first clause applies 2) all symbols with a macro definition have a
> non-nil fdefinition too.
>
> Helmut

Yes, but the fdefinition of a macro is not a function.

rg
From: Helmut Eller on
* RG [2010-03-12 23:44+0100] writes:

> In article <m2bpetqjof.fsf(a)gmail.com>,
> Helmut Eller <eller.helmut(a)gmail.com> wrote:
>
>> * RG [2010-03-12 22:52+0100] writes:
>>
>> > In article <m2y6hxqlxi.fsf(a)gmail.com>,
>> > Helmut Eller <eller.helmut(a)gmail.com> wrote:
>> >
>> >> * Rainer Joswig [2010-03-12 21:12+0100] writes:
>> >>
>> >> > From the CLHS page for COMPILE:
>> >> >
>> >> > 'if name is a symbol that names a macro, its macro function is updated'
>> >>
>> >> The whole sentence is:
>> >>
>> >> If a non-nil name is given, then the resulting compiled
>> >> function replaces the existing function definition of name and the name
>> >> is
>> >> returned as the primary value; if name is a symbol that names a macro,
>> >> its
>> >> macro function is updated and the name is returned as the primary value.
>> >>
>> >> > I would also say that this is clear.
>> >>
>> >> Are you saying that those two clauses are mutually exclusive?
>> >
>> > Yes, of course. Why would you doubt it? Function bindings and macro
>> > function bindings for a single symbol are mutually exclusive.
>>
>> OK then. That's all I wanted to know.
>>
>> >> "update" could also mean "remove the macro binding".
>> >
>> > No, it couldn't, because the first clause refers to replacing the
>> > "existing function definition." The only way there can be an "existing
>> > function definition" to replace is if it's a function, not a macro.
>>
>> Well, to be nitpicking: 1) if the symbol has no function definition the
>> first clause applies 2) all symbols with a macro definition have a
>> non-nil fdefinition too.
>>
>> Helmut
>
> Yes, but the fdefinition of a macro is not a function.

It is in CMUCL.

Helmut