Apropos of nothing, here’s a Grace version of Ackermann’s Function inspired by Sam Tobin-Hochstadt’s Racket example:
123456 method ack (m:Number, n:Number) -> Number {print "ack {m} {n}"if (m ≤ 0) then { n + 1 }elseif {n ≤ 0} then { ack((m-1), 1) }else { ack(m-1, ack(m, n-1)) }}
One interesting thing to note is that the condition after elseif is in {braces}, while the conditions after if is in (parens). This makes logical sense — because the first condition is always evaluated — but is of course inconsistent with every other condition. (Apologies for the fixed-width font.)
But elseif isn’t part of the language at all.
Well it could conceivably be in the language.
You’d just have to write a bunch of different methods Smalltalk style.