ATS2 now supports ifcase-expressions, which are similar to
the if-expressions in Erlang. Here is an example:

//
fun
acker
{m,n:nat}
.<m,n>.
(
  m: int(m)
, n: int(n)
) : intGte(0) =
(
ifcase
| m = 0 => n + 1
| n = 0 => acker(m-1, 1)
| _(*else*) => acker(m-1, acker(m, n-1))
// end of [ifcase]
)
//

Note that the ifcase-expression in the above code is equivalent
to the following one:

if m=0 then n+1 else if n=0 then acker(m-1, 1) else acker(m-1, acker(m, 
n-1))

-- 
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+unsubscr...@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/b561b9f2-e6dc-4775-82d9-b8a05d96fe1b%40googlegroups.com.

Reply via email to