This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: type declaration best practices?
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Wed, 13 Jan 2010 10:33:24 +0100
- Subject: Re: type declaration best practices?
- References: <FF51B6B0-46D4-4C37-B521-831014EB4B73@theptrgroup.com> <4AFCA0F9.3060300@bothner.com> <m2my2q3nho.fsf@gmail.com> <4AFD109E.7090307@bothner.com> <4B4AC54C.1020208@bothner.com> <m2tyut9hpc.fsf@gmail.com> <4B4D8A5C.7080407@bothner.com>
* Per Bothner [2010-01-13 09:54+0100] writes:
> One problem is do:
> (do ((i a b)) ...)
> Does this mean a is a type specifier for i, and i is initialized to b,
> or does it mean that a is the initial value and b the update expression?
Well, this one is easy. Scheme's do always has 3 arguments and never 2
so a is the init form and b is the step form. A typed version could
look like (do ((i type init step))) )
> I agree the traditional "Schemy" way to handle things like specifiers
> would be to use parenthesis grouping, and in general positional
> syntax.
IMO that's a consequence of the limitations of syntax patterns. If
syntax patterns could match keywords easily, keywords would be used more
often. Conversely, if you are going to use keywords a lot, then maybe
syntax patterns should be extended to support keyword matching.
Helmut