vectaport / ivtools

X11 vector graphic servers
Other
16 stars 13 forks source link

retrieve fixed format arguments to user-defined funcs with the arg() and narg() commands. #13

Open vectaport opened 4 years ago

vectaport commented 4 years ago

User defined funcs created with func() currently only allow for passing in of arguments via keyword parameters. Then these keywords arguments create a temporary local scope, perhaps overriding external variables. Fixed arguments (without a keyword) are not supported.

The way to support them would be make the arg() and narg() funcs sensitive to this scope once inside a user-defined func. This would also require adding a :main or :global keyword to these funcs, so that the top-level arguments can still be accessed from within a user-defined func if so desired.