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

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

Re: [Kawa-commonlisp-dev] [GSoC] Parameter protocols in CL


From: Per Bothner
Subject: Re: [Kawa-commonlisp-dev] [GSoC] Parameter protocols in CL
Date: Wed, 25 Jul 2012 16:26:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 07/25/2012 01:22 PM, Charles Turner wrote:
On 25 July 2012 18:36, Charles Turner <address@hidden> wrote:
Afraid I still haven't made much progress on the keyword parameter
bug...

I think I know what this is now. To recap

(defun test (&key ((secret password) nil)) (list password))

(test 'secret 12)
(nil)

is the problem. The mistake is that searchForKeywords is
(unsurprisingly) searching for a *keyword* not a symbol, which is,
IIUC, what's required here. So since :secret != CL-USER::secret, it
fails. It seems like LambdaExp#keywords needs to be generalised to
Symbols, but that seems a tad drastic given that this is such an
uncommon programming practice and I imagine it will break all kinds of
things later on...

It seems at first glance it might be a small change,
mainly changing the type of the keywords array from Keyword[]
to Symbol[].  The searchForKeyword methods take Object[],
so they don't care.

I agree it's not worth spending much time on, but if you can
get it working easily, that might be worth it.
--
        --Per Bothner
address@hidden   http://per.bothner.com/



reply via email to

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