mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
16 lines
283 B
Python
16 lines
283 B
Python
p! *x: Int = print! x
|
|
p! 1, 2, 3
|
|
|
|
first *x = x[0]
|
|
assert first(1, 2, 3) == 1
|
|
|
|
sum_ start: Nat, *args: Int =
|
|
sum(args, start:=start)
|
|
assert sum_(0, 1, 2, 3) == 6
|
|
|
|
f = (*_: Int) -> None
|
|
f(1, 2, 3)
|
|
|
|
_: Int -> NoneType = f
|
|
_: (Int, Int) -> NoneType = f
|
|
_: (Int, Nat) -> NoneType = f
|