Jonathan S. Shapiro wrote:
> On Thu, Mar 5, 2009 at 1:58 PM, Pal-Kristian Engstad
> <[email protected]> wrote:
>> It would preclude the OCaml-ish style:
>>
>> let _ = printf ... in
>> let _ = printf ... in
>> let _ = printf ... in
>> ()
>
> Not really:
>
> let _ = printf ... in
> and _ = printf ... in
> ()
> end
>
> The goal here isn't to be OCaml. A variant syntax for the same idiom
> is not a problem in my view.
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
Sorry if I'm not supposed to be sending to this list since I'm not
really a BitC dev, but I think SML's syntax for this is nicer than
Ocaml's and is worth looking at.
A let binding in that has this form:
let
val a = expr
val b = expr
...
in
expr
end
None of the whitespace is enforced, so this would be equivalent to:
let
val a = expr val b = expr in
expr
end
And this whole thing is a perfectly valid expression, so they can be
nested if really necessary. I don't know if this still possesses the
shift-reduce conflict that Ocaml's does, but I think the difference in
the first binding should fix it. This does have the disadvantage of not
letting you use val, let, in, or end as identifiers, but I think it
looks the nicest of any of the proposed options.
Jeff
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev