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"

"with-meta doesn't work for variable arguments functions"

"High-arity .apply on spec-instrumented function throws "Invalid arity" error"

Maybe it also fixes/completed this one from 2012:

"compiler needs to put all args of an invocation after 20 into an array-seq"

This is the patch here; a single small commit:


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.


2 Answers

0 votes

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.

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

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.