Re: Need usable fparam_ function attribute

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Lenard Lindstrom wrote:

> Now that import works for prothon modules more serious projects
> can be started. The document tools needs a solid introspection
> module. One critical piece of information is the parameter
> specifications of a function. Functions with parameters have
> a fparams_ attribute. But it is unusable from within prothon.
>
> Prothon 0.1 Interactive Console, Build 566, Jun  3 2004 (Ctrl-D to
> exit)
>>>> def foo(x, y=9, *a, **k): pass
>>>> foo.fparams_
> [`x, <NULL>, `y, 9, <objptr:1>, `a, <objptr:2>, `k]
>>>>
>
> Attempting to use foo.fparams_[1] raises a missing object exception.
> Attempting to retrieve foo.fparams_[4] causes a page fault.

This has been fixed in a recent release.

> I gather
> the current fparams_ is an interim solution. What will the final
> format be?

Try it and see.  It is pretty much as final as anything else is in Prothon.

> Will all functions have an fparam_, even those without
> parameters?

Hmm, I don't remember.  Try it and see.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.