[plt-scheme] keywords (a backward-incompatible change)
At Sun, 2 Oct 2005 10:42:44 -0500, Corey Sweeney wrote:
>
> So at this point I'm againt it. I'm looking for the value though. If the
> motive is to do something like:
>
> > (send-mail From: "Dr. Watson <guest at grimpen.moor>"
> > To: "Sherlock Homes <not-really at 221B-baker.street>"
> > Subject: "First Report"
> > Charset: "ISO-8859-1"
> > Body: "Moor is gloomy. Heard strange noise, attached."
> > Attachments: '((File: "howl.ogg")))
This was just given as an example of the aesthetic appeal of suffix as
opposed to prefix. The usual motivation is in much simpler cases,
where there are too many options to be conveniently managed as
positional parameters.
[For this specific case, you could of course use backquoted lists, but
as a slightly off-topic point please don't make it a macro! Macros
are terribly overused in the Lisp community, which is unfortunate
because they're not first class and therefore not compositional. In
the above syntax, the attachments are actually sublists of the same
keyword arguments as the main function, recursively applied to create
arbitrarily nested MIME components. With literal attachments as above
this could be handled in a macro, but more likely in a GUI the
attachments list is an unquoted reference to some structured data
somewhere, so that this couldn't be implemented with only a macro
interface.]
--
Alex