kawa-commonlisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Kawa-commonlisp-dev] 'NIL != '()


From: Charles Turner
Subject: Re: [Kawa-commonlisp-dev] 'NIL != '()
Date: Wed, 8 Aug 2012 18:19:46 +0100

On 8 August 2012 02:35, Per Bothner <address@hidden> wrote:
>> I'm wondering if there's a caveat I'm not seeing to instead just doing
>> if (symname == "NIL") return CommonLisp.FALSE
>> instead of interning the symbol.
>
> You have to check that LispPackage.currentPackage.get() is the COMMON-LISP
> package *or* one that inherits from it.  That seems more complicated
> to get right - and most likely slower, at least in the non-NIL case.

Oh, of course. I understand now. As I said before, I'm concerned about
finding the symbol and then just ignoring it by returning
CommonLisp.FALSE, you then introduce problems like this:

(multiple-value-bind (symbol where) ;; MVB because of the Values "problem".
  (find-symbol "NIL")
 (eq symbol 'nil)) ;=> ()

To make that work, we'd have to use the asSymbol method or a wrapper
thereof around 'nil. Have I implemented this incorrectly? Or is this
just a problem we may have to deal with for language compatibility?

> Well, NIL as a CL value is the same as CommonLis.FALSE, which
> is why I used the more verbose NIL_AS_SYMBOL to emphasize this is
> not the Lisp value of NIL, but the internal value as a Symbol.

Oops, I've changed that.

Charles.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]