identity is of type for all types A, A to A.
define function identity of x:
return x.
end.
constant is of type for all types A and B, A to B to A.
define function constant of x of y:
return x.
end.
define factorial of type int to int of n:
if n equals 0, then: return 1.
else: return n times factorial of (n minus 1).
end.
Name:
Anonymous2012-01-25 1:24
>>25
If it wasn't for the punctuation I think the syntax looks really nice, no symbols to be found. I know this is a joke in verbosity but looks really clean to me for some reason.
define foo of type int and float to float of a and b
return 2 times b plus a
end
[code]
But I guess when you compare it to something like
[code]
def foo(a int, b int) int
2*b+a
end