Function template syntax: a tiny question

One may write “fun {a:t@ype}{b:t@ype} f” or “fun {a,b:t@ype} f”. My guess
is that the only difference between these two syntaxes, is about the use of
“{…}”: is that it? And that it does not make a difference with regard to
“{…}”?

I’m actually reviewing INT2PROGINATS a second time, that’s how this
question came to me.

Currently, template arguments need to be all supplied or all omitted.

So “{…}” is only for parametric polymorphism?

Yes.

It is plausible to support something like the following in the future:

foo<…>, foo<…>, foo2<_,string>On Mon, Feb 2, 2015 at 4:21 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

Le lundi 2 février 2015 22:05:14 UTC+1, gmhwxi a écrit :

Currently, template arguments need to be all supplied or all omitted.

So “{…}” is only for parametric polymorphism?


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-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/8b4d1781-44ee-40f7-8119-1f34af8104b7%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/8b4d1781-44ee-40f7-8119-1f34af8104b7%40googlegroups.com?utm_medium=email&utm_source=footer
.

The difference lies in the way in which template arguments
are provided:

fun
{a:t0p}
{b:t0p}
foo (x: a, y: b) = (x, y)
val _ = foo (0, “1”)
val _ = foo (0, “1”)

fun
{a,b:t0p}
foo2 (x: a, y: b) = (x, y)
val _ = foo2 (0, “1”)
val _ = foo2<int,string> (0, “1”)

Currently, template arguments need to be all supplied or all omitted.On Monday, February 2, 2015 at 3:23:18 PM UTC-5, Yannick Duchêne wrote:

One may write “fun {a:t@ype}{b:t@ype} f” or “fun {a,b:t@ype} f”. My guess
is that the only difference between these two syntaxes, is about the use of
“{…}”: is that it? And that it does not make a difference with regard to
“{…}”?

I’m actually reviewing INT2PROGINATS a second time, that’s how this
question came to me.