[plt-scheme] keyword arguments (in v4.0, maybe)
On Jun 12, 2007, at 12:08 AM, Matthew Flatt wrote:
> At Tue, 12 Jun 2007 02:55:27 -0400, Eli Barzilay wrote:
>>> One drawback of this strategy is that `(lambda args (apply f args))'
>>> is not an all-purpose wrapper strategy, because that only works for
>>> `f' that doesn't take keyword arguments. But there would be a new
>>> way to create wrappers that works for both plain and
>>> keyword-accepting procedures.
>>
>> Note that this one is a radical change. It means that using keywords
>> will "infect" code: using keyword-unaware code will not be possible
>> with keyword aware code. For example, SRFI code (or any portable
>> Scheme code) can assume that
>>
>> (lambda args (apply f args))
>>
>> is exactly equivalent to `f' -- but this will not be the case for
>> keyword procedures.
>
> Of course, it's also not the case for numbers, lists, regexps, etc.
>
> So probably `procedure?' should return #f for things that are like
> procedures, but that require some keyword (as opposed to things that
> work like procedures and accept keyword-based arguments, but all the
> keyword arguments all optional). Then, the above remains true for
> procedures.
>
> Meanwhile, it's true that there's a kind of infection to the
> design, in
> that many tools and libraries should be made to work with both
> procedures and keyword-requiring things. But maybe working only for
> procedures (that don't require any keywords) is a reasonable
> specification for other tools and libraries.
>
> What examples do we have, other than `trace'?
IIUC, this would include my tiny no-brainer tool, perhaps check
syntax, the stepper (if keywords affect teaching languages).
How about the contract system? Can you write contracts for these things?
What would the expansion look like?
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2223 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20070612/5be2cf21/attachment.p7s>