chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: A few questions


From: Hans Nowak
Subject: [Chicken-users] Re: A few questions
Date: Tue, 29 Jan 2008 16:11:43 -0500
User-agent: Thunderbird 2.0.0.0 (Macintosh/20070326)

Kon Lovett wrote:

On Jan 29, 2008, at 11:08 AM, Hans Nowak wrote:
> (get-docstring foo)
"docstring for foo"

Yes, but not with a documented interface. The procedure '(##sys#decorate-lambda proc pred decorator)' can create arbitrary "decorations" for a procedure. Then, '(##sys#lambda-decoration proc pred)' can retrieve it.

Let me look into this.

I saw these procedures in the source, but haven't figured out how to use them yet. :-(

Anyway, I have another question: when you define a function, how much "introspection" is possible? E.g. from another thread ("Runtime arity") I learned that it's possible to get the function's signature. Is there also a way to get e.g. the function's body? (My guess is, probably not, but I thought I'd ask.)

No. Why do you want it?

No real reason, at least not at this moment; I was just trying to get an idea of how "introspective" Chicken is. Like, in Python you can get *some* information about a defined function (like its signature, bytecode, etc), and in languages like Io you can get the actual source. I figured that it would at least be technically possible to get this kind of info. I don't have a real purpose for it at this moment though. :-}

--Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]