Somewhat in haste, for I'm off to Scotland for 3 months sailing next week:
[1] I very much agree that sequences are the right high level abstraction.
However, I'm coming to the conclusion that Rod and I chose the wrong
convention - that 0-indexing is the RIGHT way to go. Justifying this would
take more time than I have at the moment. I'll try to write a paper on't.
[2] One advantage of a defined abstract syntax a la Lisp is that it
supports better, more principled, interaction of macros. It's improved even
more if aspects of the compile-time environment are available, most
especially signatures. I think that there are two classes of "macro":
(a) Those that extend the syntax. It's natural for these to operate
on the token-stream a la POP, or, in some cases, on the character
stream a la LISP character macros.
(b) Those that perform a semantic transformation. It's natural for
these to operate on the abstract syntax, and ideally the
transformations they perform should be provably correct.
A given facility might involve both (a) and (b). For example a let
statement involves a syntax extension
let x=1, y=2 in x+y endlet
is transformed to:
procedure(x,y) x+y endprocedure(1,2)
while this is transformed, by beta-reduction to:
1+2
and by constant folding to 3. The latter two transformations might be
performed automatically by default, but they should be transformations
available for user specification.
Robin.
|