[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portable way to get a function's arg list AND DOC STRING??
Date: Wed, 25 Mar 1992 09:31 EST
From: hall@aplcen.apl.jhu.edu (Marty Hall)
But this brings up another question: does
something like ARGLIST really require carrying extra baggage (as maintaining
the doc strings clearly do)? Wouldn't an implementation have to store
this somewhere in the function object anyhow, so that ARGLIST would just
involve knowing how to extract it?
No, a compiled function just has to have code to extract the arguments
from the stack, and perhaps check the number of arguments. Extracting
it would involve decompiling the function and looking for those
instructions.
The compiled function certainly has no need to remember the names of the
arguments, which is usually what you're interested in when you use
ARGLIST.
barmar