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

[no subject]



I would like to hear strong arguments opposing the following syntax (other
than how ingrained it is into code -- we'll assume we are designing some new
dialect that doesn't care about sharing code so that we don't quibble about
that sort of thing):

 A bvl is either a symbol or a list. If it is a list, then the car of the
 list is a declaration, the cadr is the object of the declaration (which must
 be a symbol or another declaration), and the remainder are various attributes
 particular to declaration. Eg, (OPTIONAL var default varp) is a possible 
 declaration. Likewise, (REST var) or (FIXNUM var). If you insisted on &quote 
 type functionality, you could even make it (QUOTE var) so that 'var would
 work.

As a result, you would write

 (DEFUN F (X Y &OPTIONAL Z (W W-DEF) (WW WW-DEF WW?) &REST GUNK &AUX (A 3))
	...)

as 

 (DEFUN F (X Y (OPTIONAL Z) (OPTIONAL W W-DEF) (OPTIONAL WW WW-DEF WW?))
	(LET ((A 3))
	     ...))

Note that the following:

 (DEFUN PROBABLY-SEVEN (&OPTIONAL (X 3) (Y 4))
	(DECLARE (FIXNUM X Y))
	(+ X Y))

would become

 (DEFUN PROBABLY-SEVEN ((OPTIONAL (FIXNUM X) 3)
			(OPTIONAL (FIXNUM Y) 4))
	(+ X Y))

or

 (DEFUN PROBABLY-SEVEN ((FIXNUM (OPTIONAL X 3))
			(FIXNUM (OPTIONAL Y 4)))
	(+ X Y))

This has a feature of being pre-parsed, and parsed in a structure which is
useful to the various sorts of programs that need to interpret this stuff.
It is somewhat larger in code size, but then so is (+ X Y) bigger than
X+Y and we have gotten away from that for good reason.

Comments appreciated.
-kmp