Bill Allombert on Mon, 04 Mar 2019 23:41:19 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Getting arity of closures |
On Mon, Feb 25, 2019 at 09:30:06PM +0000, Jacques Gélinas wrote: > >It would seem to me that this should work: > > ? install("closure_arity","lG") > > Nice solution, but does not work for some builtins. > > vc = vector; > vc(1,k,k) > *** at top-level: vc(1,k,k) > *** ^--------- > *** too many parameters in user-defined function call. > closure_arity(vc) == 2 This is correct: the loop index name is not a function parameter, so vector only has two arguments, the length and the inline closure. Cheers, Bill.