Multiple return values

John Rose john.r.rose at oracle.com
Tue Jan 15 01:58:46 UTC 2019


On Jan 14, 2019, at 12:49 PM, forax at univ-mlv.fr wrote:
> 
> yes, i fully agree, it's just syntactic sugar on top of records and pattern matching.
> That's what's make the proposal great and stupid at the same time.
> It's great because it's just syntactic sugar and it's stupid because it's just syntactic sugar, and like any syntactic sugars it can make the code less readable because it carries an implicit semantics.
> 
>> 
>> If, at the end of the game, we decide that the straight denotation of
>> pattern matching isn't enough, we can revisit. 
> 
> yes !

+1 revisit much later

I think this is a kind of target-based type inference.

It is as if a tuple-like expression (x, y) were a poly
expression, whose type depends on the target type.
After inference, a pattern or constructor head is
supplied, as T(x, y).  That's not completely alien
to our bag of tricks.  But is is way down the road.

We can't even evaluate it until we have the regular
T(x, y) form of patterns deployed, so we can gather
experience using them *without* the extra type inference.

— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190114/300bc805/attachment.html>


More information about the amber-spec-experts mailing list