libera/#commonlisp - IRC Chatlog
Search
19:41:41
jmes
Hey folks, when you define an initialize-instance :after method and you give it a keyword parameter, does that mean you would be able to pass that keyword parameter to make-instance?
19:53:29
pve
jmes: that should be the case, see http://www.lispworks.com/documentation/HyperSpec/Body/07_ag.htm
19:56:19
yitzi
jmes: You can pass any keyword parameter to make-instance. INITIALIZE-INSTANCE and others all have &allow-other-keys.
19:58:21
Shinmera
make-instance must error on unrecognised keyword arguments. A keyword argument is recognised if it is a slot initarg, or if it is defined as a keyword argument on an applicable initialize-instance or shared-initialize method.
20:02:56
Bike
yeah it's a bit confusing. they have allow other keys but that's only because make-instance does this special checking instead of the normal checking.
20:27:56
pjb
Shinmera: that's not true; make-instance takes &rest. It passes them to initialize-instance which takes &rest. It passes them to shared-initialize, which has &key &allow-other-keys !
21:00:47
Bike
there is an entire subsection on the CLHS specifically describing how make-instance and co reject keyword arguments. this is not ambiguous. you cannot pass any keyword to make-instance.
21:01:00
specbot
Declaring the Validity of Initialization Arguments: http://www.lispworks.com/reference/HyperSpec/Body/07_ab.htm
21:01:27
Bike
and of course the page on make-instance says "The initialization arguments are checked within make-instance."
21:05:00
Bike
if you're going to try to out-pedant someone please take the effort to ensure you are saying true things
21:17:05
Bike
don't try to play this off with "yes". i am disagreeing with you. someone said something and you tried to correct them with something false.
4:52:34
jmes
Sorry I dropped my question and ran off for a bit. The answer illuminates some neat behaviour, thanks! Now I should go delete some redundancy in my code...