Exemplo n.º 1
0
 def f(x):
     if hastype(x, i64):
         return x
     elif hastype(x, f64):
         return f(_to_i64(x))
     elif hastype(x, ai64):
         return 0.0
     elif hastype(x, Point_t):
         return f(x.x) * f(x.y)
     elif hastype(x, Nil):
         return 0
     elif hastype(x, Tf4):
         return x
     elif hastype(x, T):
         return f(x[0]) + f(tail(x))
     elif hastype(x, L):
         return 1.0
     elif hastype(x, Thing_ftup):
         return x.contents
     else:
         return 0
Exemplo n.º 2
0
def test_tail_tuple_wrong(x, y):
    return tail(x, y)
Exemplo n.º 3
0
def test_tail_tuple(tup):
    return tail(tup)