[Openmcl-devel] dfsl/foreign function oddities

Chris Curtis enderx12 at mac.com
Fri May 13 21:24:44 PDT 2005


On May 13, 2005, at 8:04 PM, Gary Byers wrote:
> On Fri, 13 May 2005, Chris Curtis wrote:
>
> I think that in the relatively recent past, someone suggested that # 
> $foo
> look up and return the value of the foreign constant "foo", rather  
> than
> doing something like:

Seems like a reasonable approach... I don't think in Lisp yet, but to  
me returning the value of the foreign constant feels more intuitive  
than defining-and-returning-a-symbol.

> The only reason that I can think of for not doing that is the  
> (presumably)
> small possibility that there's code somewhere that somehow depends on
> #$foo returing a symbol.  There probably isn't much such code, if any,
> and it's probably worth making this change.

I haven't written enough code that uses it to be entitled to an  
opinion, but it sounds good. ;-)

> Yes, that's ugly, and since (IIRC) I wrote it (at least the READ- 
> FROM-STRING
> part), I should probably be disqualified from making any judgements  
> about
> style.  Ever.

I'm certainly not in a position to criticize, nor to assess the  
impact on existing code, in OpenMCL or user-written. But it does seem  
that in most cases the change should be pretty simple, and a lot less  
surprising in macro-expansions.

> I can't think of a clean solution to the problem when #_ is involved.

No, none springs to mind here either. Seems like the best solution is  
to RTFM and pay attention when it says "these may not do what you  
want them to do in macro expansions." Maybe at some point make the  
documentation a little more verbose and emphasize the side effects.

Thanks for the thorough explanations and help though!

--chris




More information about the Openmcl-devel mailing list