tov / dssl2

A data structures student language, version 2
MIT License
9 stars 5 forks source link

Varargs functions and varargs application #12

Open tov opened 5 years ago

tov commented 5 years ago
def sum(*args):
    let res = 0
    for a in args: res = res + a
    return res

assert_eq sum(1, 2, 3, 4), 10
assert_eq sum(1, *[2, 3, 4]), 10