From ... From: Erik Naggum Subject: Re: lambda list in MULTIPLE-VALUE-BIND? Date: 1998/03/08 Message-ID: <3098340336248874@naggum.no>#1/1 X-Deja-AN: 331914577 References: <3098288658259597@naggum.no> <6dsm0u$st3@pravda.cc.gatech.edu> mail-copies-to: never Supersedes: <3098337228503292@naggum.no> Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * lyman@cc.gatech.edu (Lyman S. Taylor) | In short I'd say that the list of variables in MULTIPLE-VALUE-BIND is | just that a list of variables. It isn't a lambda list...... nor was it | intended to be a lambda list. sigh. I _know_ that, dammit. the question is _why_. | How can a function "already" know? There is no restrictions placed upon | the values form. It could be any expression. sigh. when a function returns a number of values, the receiving code (remember? there's actually a computer underneath here) _knows_ at that time how many values it received. it isn't constant, if that's what you think, but it _has_ to know, one way or the other, because it will take actions that depend on such knowledge, like binding variables with no corresponding value to NIL. if it had no clue how many values it received, it couldn't do that, OK? so when it already has that value, I want to cause an error if it is not the number I expect, _without_ having to engage in very expensive operations or cons up the values into a list -- I might just as well return a list, then, were it not for the fact that I do need the distinction between the primary value and the non-primary values in other contexts. | In three of the environments I tried the following example in utilized | mutliple-value-call in the expansion of multiple-value-bind.... However, | one did the following.... the compiler is not obliged to do the same kind of macroexpansion as you are. you have to look at the compiled code or know your compiler better to understand how it does its work. compiler-macros do weird stuff. but aren't you aware that DESTRUCTURING-BIND will barf on the wrong number of bound variables already? there's no need to reinvent it. #:Erik -- God grant me serenity to accept the code I cannot change, courage to change the code I can, and wisdom to know the difference.