Welcome! Please see the About page for a little more info on how this works.

+4 votes
in ClojureScript by

Hi there,

I prepared a patch to fix the problem that IFn's cannot be called with more than 20 arguments.
The corresponding test cases in apply_test.cljs had been commented out some years ago.

This most probably fixes meta functions, multi methods, spec functions and every IFn implementation out there.

These are corresponding tickets I found:

"mulitmethod apply with >20 args fails"
https://clojure.atlassian.net/browse/CLJS-3024

"with-meta doesn't work for variable arguments functions"
https://clojure.atlassian.net/browse/CLJS-2446

"High-arity .apply on spec-instrumented function throws "Invalid arity" error"
https://clojure.atlassian.net/browse/CLJS-2710

Maybe it also fixes/completed this one from 2012:

"compiler needs to put all args of an invocation after 20 into an array-seq"
https://clojure.atlassian.net/browse/CLJS-364

This is the patch here; a single small commit:

https://github.com/active-group/clojurescript/commit/122e1ab4be7230841e15b392223d4b33560cfa5b

It also removes a superfluous 'aclone' call (concat already makes a shallow clone).

I ran the tests with Nashorn, and the tests that were previously commented out succeed now.

I signed the Contributors Agreement in 2016, but after signing up to the JIRA now, it says that I don't have 'access to Jira on clojure.atlassian.net', which is why I start with this question here.

Hoping this gets though, as I was basically waiting for this to be fixed for years now.

David.

2 Answers

0 votes
by

I sent you an invite for jira based on your old CA. If you don't see that come through or your email has changed, ping me at alex.miller@cognitect.com.

by
Thanks!
Does it help if I add comments there too; maybe with a link to this page?
Or is this enough?
by
Once you're in jira, it's preferred to do dev work there, you don't need to update here.
0 votes
by

Hello thanks for looking into this. The proposed patch only solves the problem for top-level fns - a proper fix also requires changes to the compiler fn codegen to cover the anonymous fn cases.

...