I have seen so many people tripped on this one.
In the following code, the if-expression is given the type X,
which is checked to be a subtype of 'int':
val newN: int =
if nn % 2 = 0 then nn / 2 else 3 * nn + 1
When you do the following later,
val () = println! ("newN = ", newN)
you will get a type-error message stating that the print function
for newN cannot be found.
Instead, please use the following style of type annotation:
val newN = (if nn % 2 = 0 then nn / 2 else 3 * nn + 1): int
I hope to find a way to address this issue in ATS3.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit