Tupz: is it syntactic sugar or more?

29 views
Skip to first unread message

Yannick Duchêne

unread,
Jul 7, 2018, 3:13:52 PM7/7/18
to ats-lang-users
Postiats defines a built‑in symbol named `tupz` which is to be used as `tupz!` (an added `!` like with `println!` and the likes).

It seems to turn a list of expressions (space separated like for function application) into a flat tuple (a flat record where labels are increasing integers).

But I don’t get the intent.

Why have this:

        val a = tupz! 1 2 3

Instead of this:

        val a = @(1, 2, 3)

Is this syntactic sugar or is there more with it?

Hongwei Xi

unread,
Jul 7, 2018, 5:14:49 PM7/7/18
to ats-lan...@googlegroups.com
At one point, I wanted to give the user a way to
introduce special syntax into ATS. I did not really
go far. The keyword 'tupz' was a result of this experiment.

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/6553ba3d-fb25-4553-b637-cb0e12a6f2b3%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages