Browse thread
RE: [Caml-list] variant with tuple arg in pattern match?
- jgm@c...
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | jgm@c... |
| Subject: | RE: [Caml-list] variant with tuple arg in pattern match? |
> Type-based compilation strategies such as TAL and FLINT can deal with
> this issue, but at considerable cost in complexity of the compiler and
> execution speed.
Er, you mean TIL :-) TAL doesn't care which one you choose.
> Frankly, I think there is no point in maintaining the illusion that
> datatype constructors are either nullary (constant) or unary. The
> only efficient implementation model is N-ary constructors, so let's
> reflect this in the language.
I agree. Besides, if you're going to go the uniform route, why not
have all constructors be unary? This always annoyed me in SML.
> I agree that in an ideal world the syntax of the declaration should
> make this more explicit, e.g. the CamlP4 way ("Foo of int and int"
> vs. "Foo of int * int"). The current "syntactic overloading" of "*"
> in constructor declarations is sometimes misleading, but did make the
> conversion from Caml V3.1 code convenient a long, long time ago...
What's wrong with "Foo of int,int" or "Foo of (int,int)"?
JGM
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr