This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project. See the Kawa home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: type specifiers for local variables



I'm glad to see this discussion.  Clearly, naturalness is in the
eye of the beholder ...  I do find:
	(let (((i <int>) 10)) ...)
to be more natural than:
	(let (((<int> i) 10)) ...)

Somebody mentioned that the latter is more easily parseable than the
former;  that is not the case.  Remeber, that at least potentially we
want that type-specifiers can be first-class expressions, for example
a parameter of the surrounding first-class function.

People who prefer either of these two variants have not commented
on the fact that neither works with `define', because it would
conflict with the existing function definition syntax.  While we
could support type specifiers without allowing them for define,
I think that is a fairly serious disadvantage.  This is especially
the case, since I think providing all of let, let*, letrec, and
internal define is poor language design, and a well-engineered
language would only have some variant of internal define.  (For the
few times you need let or let*, you can use a lambda.)

I really don't like the Common Lisp declare form.  I think the
type specification should be in the same place as the where the
identifier is declared.  (I.e. `declare' should be in the same
place as the declaration!)

People have suggested that VAR :: TYPE is not "Schemish".
I don't see that.  Scheme already has "internal" keywords
('else and '=>);  I don't think adding ':: conflicts with
that tradition.  I still think it is easier for humans to
read, less like to lead to errors, and less likely to conflict
some other extension from some other Scheme dialect.

What might convice me to go for ((VAR TYPE) INIT) instead
of (VAR :: TYPE INIT) would be pointers to other Scheme
implementation or related languages that use that syntax.
The Dylan reference is an interesting note, but of course
Lisp-style Dylan no longer exists.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner