Reputation: 132
I suspect that this might be a colossally dumb question, but I have searched through the documentation for Rebol 2 (what there is) and have not found a good explanation. The question is this: is there a simple way to determine a function's arity in Rebol? If not, why not? It seems to me that that knowledge is crucial to being able to read Rebol code, and that it should be (more) easily available.
Of course, I can write such a function myself:
>> source arity
arity: func [f [any-function!] /local ac][
ac: 0
parse first :f [
some [[word! | lit-word! | get-word!] (ac: ac + 1)]
any [refinement! to end]
]
ac
]
But I would hardly call this simple. Can anyone explain why this isn't provided?
Upvotes: 2
Views: 46