Generic implementation syntax: the space before `<`

In:

extern fun {a: t@ype} gprint (x: a): void

implement gprint (x) = print_int (x)

If the second definition is changed into:

implement gprint (x) = print_int (x) // White‑space inserted before

I get the message “the keyword [=] is expected”

Seems a space is required before generic’s parameters. Is this on purpose
or an unintentional effect of ATS2 parser actual implementation?

On the opposite of disallowed space, this one is to be noted too, as a case
of optional space:

val+list_cons (x, xs) = xs
Although without a space, it stands for this
val+ list_cons (x, xs) = xs

I guess it’s the same for all keywords ending in + or -.

I’ve never seen it not that way in many cases, so I assume it is intended.
Brandon Barker
brandon…@gmail.comOn Fri, Aug 8, 2014 at 8:44 PM, ‘Yannick Duchêne’ via ats-lang-users ats-lan...@googlegroups.com wrote:

In:

extern fun {a: t@ype} gprint (x: a): void

implement gprint (x) = print_int (x)

If the second definition is changed into:

implement gprint (x) = print_int (x) // White‑space inserted before

I get the message “the keyword [=] is expected”

Seems a space is required before generic’s parameters. Is this on purpose or
an unintentional effect of ATS2 parser actual implementation?


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/c94afd49-a97b-44ba-9be6-3954cc9e58e8%40googlegroups.com.

Yes, the space following val+ is optional. The same
can be said about val-, case+, and case-.On Friday, August 8, 2014 11:40:04 PM UTC-4, Yannick Duchêne wrote:

On the opposite of disallowed space, this one is to be noted too, as a
case of optional space:

val+list_cons (x, xs) = xs
Although without a space, it stands for this
val+ list_cons (x, xs) = xs

I guess it’s the same for all keywords ending in + or -.

Yes, it is intentional.On Fri, Aug 8, 2014 at 8:44 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

In:

extern fun {a: t@ype} gprint (x: a): void

implement gprint (x) = print_int (x)

If the second definition is changed into:

implement gprint (x) = print_int (x) // White‑space inserted before

I get the message “the keyword [=] is expected”

Seems a space is required before generic’s parameters. Is this on purpose
or an unintentional effect of ATS2 parser actual implementation?


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/c94afd49-a97b-44ba-9be6-3954cc9e58e8%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/c94afd49-a97b-44ba-9be6-3954cc9e58e8%40googlegroups.com?utm_medium=email&utm_source=footer
.