I'm trying to determine what the result of this should be:
(labels ((foo () t)) (eq #'foo #'foo))
I wasn't sure where to look in the spec, but the closest thing I found
was under FUNCTION:
If name is a function name, THE functional definition of that name
is that established by the innermost lexically enclosing flet,
labels, or macrolet form, if there is one. (emphasis added -joelh)
The use of the term THE may imply that they need to be EQ, but it's
not a very strong argument.
My testing indicates that under CMUCL, the above form returns NIL when
interpreted, but T when compiled. If I replace LABELS with FLET, it
returns T even when interpreted.
Anybody have any thoughts on this matter?
Thanks,
joelh
Joel Ray Holveck <·····@juniper.net> writes:
> I'm trying to determine what the result of this should be:
>
> (labels ((foo () t)) (eq #'foo #'foo))
>
> I wasn't sure where to look in the spec, but the closest thing I found
> was under FUNCTION:
My reading of the spec doesn't require FUNCTION to return EQ values.
I certainly wouldn't depend on it.
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'