[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggestion for LET extensions
- To: byron at MIT-ML
- Subject: Suggestion for LET extensions
- From: JONL at MIT-MC (Jon L White)
- Date: Tue, 14 Aug 79 10:53:00 GMT
- Cc: (BUG LISP) at MIT-MC
- Original-date: 14 AUG 1979 0653-EDT
Date: Sun, 13 Aug 79 20:11:32 GMT
Original-Date: 08/13/79 16:11:32 EDT
To: (BUG LISP) at MIT-ML
I have a suggestion for augmenting LET in the direction of
type declaration. Instead of limiting LET to variables
or (variable-structure init-val), how about adding a third
item which would be a type declaration? Separate
declare statements would then be less necessary.
(let ((x (plus a b) flonum)
((u v w) (foo a b c) (flonum notype fixnum)))
would bind x with initial value (plus a b) and type flonum, and
would bind u, v, and w to the car, cadr, and caddr of (foo a b c)
and declare them to have the types indicated.
The part about a third item in the LETlist, "(x (plus a b) flonum)"
sounds good to me, but the compound form "((u v w) (foo a b c) ...)"
loses since it conflicts with the "destructuring" syntax of LET; i.e.,
this should mean "bind u to the CAR of the value of (foo a b c), bind
v to the CADR, and bind w to the CADDR".