|
From: | Elf |
Subject: | Re: [Chicken-users] Re: A few questions |
Date: | Thu, 31 Jan 2008 10:59:30 -0800 (PST) |
i was bringing up the case-lambda and parameters as being special cases offorms with the number of required args not necessarily the same as the maximum number of args, ie its 'rest?' but its not a true rest, in that only
certain values are valid arities. im fundamentally opposed to returning with call-with-values any more than absolutely required. as this is inherently related data that would most often be checked together, returning it as a call-with-values doesnt make sense to me. i wasnt necessarily thinking of it as a true pair, just trying to mull over representations. for my second thought, regarding simplya valid-arity?, the representation would probably just be one extra byte per function (top bit - rest? bottom 127 = min arity).
-elf On Thu, 31 Jan 2008, John Cowan wrote:
Elf scripsit:simplest arity is a pair, int . bool, required args and rest?.Better yet, return two values.optionals present a problem: do we want to keep defaults, names, or just ordering?I don't much care; the above would be plenty for me, as it allows you to correctly invoke the function via apply. The documentation issue isn't so important.additionally, whats the arity of case-lambda? or of parameters?In both cases, it's 0 with rest params. Case-lambda is a macro, not something fundamental.
[Prev in Thread] | Current Thread | [Next in Thread] |