Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable arity checks #460

Closed
borkdude opened this issue Dec 10, 2020 · 2 comments
Closed

Option to disable arity checks #460

borkdude opened this issue Dec 10, 2020 · 2 comments

Comments

@borkdude
Copy link
Collaborator

user=> (sci/eval-string "(defn f [a b c] 1) (f)" {:disable-arity-checks true})
1
user=> (sci/eval-string "(defn f [a b c] [a b c]) (f)" {:disable-arity-checks true})
[nil nil nil]

For multi-arity fns this needs more thought:

11:21 AM
multi-arity functions should be handled differently probably:
cljs.user=> (defn foo ([a] 1) ([a b] 2) ([a b & cs] :varargs))
#'cljs.user/foo
cljs.user=> (foo)
            ^
WARNING: Wrong number of args (0) passed to cljs.user/foo at line 1
:varargs
cljs.user=> (defn foo ([a] 1) ([a b] 2))
#'cljs.user/foo
cljs.user=> (foo)
            ^
WARNING: Wrong number of args (0) passed to cljs.user/foo at line 1
Execution error (Error) at (<cljs repl>:1).
Invalid arity: 0
borkdude added a commit that referenced this issue Dec 10, 2020
@mk
Copy link
Collaborator

mk commented Dec 10, 2020

Can confirm this works for us, thanks for adding this!

borkdude added a commit that referenced this issue Dec 10, 2020
borkdude added a commit that referenced this issue Dec 10, 2020
borkdude added a commit that referenced this issue Dec 10, 2020
@borkdude
Copy link
Collaborator Author

@mk Merged to master. cc @bbss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants