Re: Guile Introspection

2007-07-12 Thread Thien-Thi Nguyen
() Andy Wingo <[EMAIL PROTECTED]> () Mon, 09 Jul 2007 12:57:41 +0200 (I would really like to be able to get line numbers so that the documentation that I autogenerate based on introspection can be ordered as it appears in the source. I poked at this a couple hours and failed.) below i

Re: Guile Introspection

2007-07-10 Thread Marco Maggi
"Mike Gran" wrote: >what is the scheme version of the following C code > >printf("%s %d\n", __FILE__, __LINE__); A better solution[1] than the other I posted. Still far from perfect. [1] -- Marco Maggi "They say jump!, you say how

Re: Guile Introspection

2007-07-09 Thread Ludovic Courtès
Hi Andy, Andy Wingo <[EMAIL PROTECTED]> writes: > On Sun, 2007-07-08 at 17:18 +0200, Ludovic Courtès wrote: >> As for the file name and line number, you can in theory get them >> (provided Guile runs in "debug" mode) using `procedure-source' and >> `source-properties', although the details escape

Re: Guile Introspection

2007-07-09 Thread Andy Wingo
Hi, On Sun, 2007-07-08 at 17:18 +0200, Ludovic Courtès wrote: > As for the file name and line number, you can in theory get them > (provided Guile runs in "debug" mode) using `procedure-source' and > `source-properties', although the details escape me now. I actually don't think this is true; pro

Re: Guile Introspection

2007-07-08 Thread Marco Maggi
Ciao, "Mike Gran" wrote: >Or, what is the scheme version of the following C code > >printf("%s %d\n", __FILE__, __LINE__); I like a solution that redefines DEFINE without introducing an environment in the body of the function. To do it: you have to take the body in question and treat it as a tree

Re: Guile Introspection

2007-07-08 Thread Ludovic Courtès
Hi, Mike Gran <[EMAIL PROTECTED]> writes: > For example, how can I write a function that prints its own name? In Scheme, functions are first-class objects that are not necessarily bound to a top-level name. For instance, a `lambda' is nameless: (lambda args ...) Thus, there is no generi

Re: Guile Introspection

2007-07-07 Thread Issac Trotts
On 7/7/07, Mike Gran <[EMAIL PROTECTED]> wrote: Hi- Is it possible to get introspection information out of Guile (preferably without having to load GOOPS)? For example, how can I write a function that prints its own name? You can define a macro to make this happen: (defmacro define-named (