Identical Keyword Parameter

Discussion of Common Lisp

Identical Keyword Parameter

Postby learningcommonlisp » Sat Jul 14, 2012 8:50 am

Hello,

I have a quick question.

Consider this:
((lambda (&key k) k) :k 1 :k 2)
=> 1 ; on my system

Is the outcome of this form well defined by the standard?

Thanks,
Frank
learningcommonlisp
 
Posts: 3
Joined: Thu Jun 21, 2012 4:11 pm

Re: Identical Keyword Parameter

Postby Kompottkin » Sat Jul 14, 2012 11:34 am

http://www.lispworks.com/documentation/HyperSpec/Body/03_dad.htm:

For each keyword parameter specifier, if there is an argument pair whose name matches that specifier's name (that is, the names are eq), then the parameter variable for that specifier is bound to the second item (the value) of that argument pair. If more than one such argument pair matches, the leftmost argument pair is used.
User avatar
Kompottkin
 
Posts: 94
Joined: Mon Jul 21, 2008 7:26 am
Location: München, Germany


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 2 guests