[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion for LET extensions



From:     BYRON@MIT-ML
Date: Sun, 13 Aug 79 20:11:32 GMT
Original-Date: 08/13/79 16:11:32 EDT
Subject:
    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.
    E.G.
    (let ((x (plus a b) flonum)
	  ((u v w) (foo a b c) (flonum notype fixnum)))
	 <compute>)
    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".