Allow multiple functions with different arities
This commit is contained in:
1 parent
63dbac28ad
commit
088a42fc53
3 files changed
+51
-2
No files matched your search
@@ -434,6 +434,11 @@ def f(x): x | x; f([.], . + [42])
|
||||
[[1,2,3,42]]
|
||||
[1,2,3,42,42]
|
||||
|
||||
# test multiple function arities and redefinition
|
||||
def f: .+1; def g: f; def f: .+100; def f(a):a+.+11; [(g|f(20)), f]
|
||||
1
|
||||
[33,101]
|
||||
|
||||
# test closures and lexical scoping
|
||||
def id(x):x; 2000 as $x | def f(x):1 as $x | id([$x, x, x]); def g(x): 100 as $x | f($x,$x+x); g($x)
|
||||
"more testing"
|
||||
|
||||
Reference in new issue
Block a user