Jonathan S. Shapiro wrote:
> This is a completely separate issue. For the moment, the question I
> want to focus on is how to separate the end of the expression that is
> scoped by the let from the end of the entire let. Let's stick with
> that.
>
This is really an issue of sequencing using semi-colon, right? This is
an issue because one mixes statements and expressions. I'd prefer to
have a stronger syntactical difference between the two. This can be
achieved by using do { stmt; strmt } for a block. Then you'd get
do { let x = 1 in x;
let y = x + 2 in y } // Unbound value: x
Or:
let x = 1 in do { x; let y = x + 2 in y } // Ok.
You can argue that the above is a bit strange. One solves that by
creating a new form of let that doesn't use "in":
do { let x = 1; // A different let, lives until end of scope.
let y = x + 2; //
y }
You could even let go of the "let" in this case:
do { x = 1;
y = x + 2;
y }
This shouldn't be a problem if assignment uses a different syntax. For
instance:
do { x = 1;
y = x + 2;
x := y;
y }
If we dispense with the "do" key-word, we end up with something looking
strangely similar to C. :-)
Thanks,
PKE.
--
Pål-Kristian Engstad ([email protected]),
Lead Graphics & Engine Programmer,
Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North,
Santa Monica, CA 90404, USA. Ph.: (310) 633-9112.
"Emacs would be a far better OS if it was shipped with
a halfway-decent text editor." -- Slashdot, Dec 13. 2005.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev