[plt-scheme] keyword arguments (in v4.0, maybe)
On Jun 13, 2007, at 5:28 AM, Jens Axel Søgaard wrote:
> Robert Nikander skrev:
>> Any interest in having an option to read symbols ending in ':' as
>> keywords? (like srfi 88) I personally find this prettier and
>> easier to read.
>> (greet "John" last: "Doe" hi: "Howdy")
>> I'm imagining that we could turn it on/off with something like
>> #reader-options ...
>> at the top of a file? That would preserve any existing code that
>> used symbols ending in ':'.
>
> If two modules have conflicting exports it is fairly common to
> import them like this:
>
> (require (prefix srfi: (lib "1.ss" "srfi"))
Yeah, I use that style too. But since (prefix <prefix> <module-
name>) is a special form, it would simply allow symbols or keywords
(or even strings) for <prefix>. So, the above form would still
work. Not a problem right?
Benefits:
1. Easier to read, because it follows natural language.
1.a. More obvious and appealing to new users. (I'm willing to bet.)
2. Easier on the hands (no shifted top-row), especially if you type
with 10 fingers (see: dvorak) as opposed to two, hovering over the
keyboard. :)
Drawbacks:
?
I've also used an existing Scheme implementation (Kawa) that had
keywords like "this:" as well as namespaces with colons. No problems.
Rob