[bitc-dev] Pairing convenience syntax
Jonathan S. Shapiro
shap at eros-os.org
Thu Aug 25 18:37:33 EDT 2005
The latest specification has a provisional convenience syntax for pair
that is not yet implemented. I would appreciate input.
The specification currently says that
(a, b) => (pair a b)
(a, b, c) => (pair a (pair b c))
PAIR is a value type, so the above syntax can have some strange
repurcusions. In particular:
(a, (b, c)) => (pair a (pair b c))
and therefore
(a, b, c) unifies with (a, (b, c))
A possible alternative is to say that the syntax is
a,b
that is: unparenthesized. I am inclined not to do this, because it
introduces some annoying operator precedence issues. Also, it would
create the following *alternative* anomaly:
(a, b) => ((pair a b)) => ((pair a b) ())
which is application. Of the two, I think that the nested parenthesis
issue is the lesser surprise.
Can anyone articulate a compelling reason to choose "a,b" over "(a,b)"?
shap
More information about the bitc-dev
mailing list