guile-user
[Top][All Lists]
Advanced

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

Re: defined?


From: Egil Moeller
Subject: Re: defined?
Date: Mon, 13 Jan 2003 14:01:53 +0100 (CET)

> I agree.
>
> However, I have a suggestion:
>
> I've always thought of the-environment, procedure-environment,
> local-eval etc as part of a "reflection API" rather than the standard
> API.  They are, for example, excellent for things like implementing
> debugging tools.
>
> I suggest that we keep these as part of the reflection API as long as
> convenient, but clearly state that they are not part of the standard
> API.  I further suggest that the reflection API make no guarantees for
> the future, but rather is allowed to change along with the
> implementation.

Perheaps I should explain the usage I intended in my original post:

I'm writing a wrapper around GladeLib, a library that reads an
XML-user-interface-description (generated by the WYSIWYG GUI-editor
Glade), and constructs a set of Gtk+-widgets. It is compatible with, and
uses/extends guile-gtk.

In GladeLib, there's a function called glade_xml_autoconnect. It will, for
each signal method named in the XML-file, look up an exported
function with the same name in the binary and all loaded modules, and bind
that function to the signal.

I have mirrored this functionality i guile-glade, but would like to extend
it to also search the closure from within which
glade-xml-signal-autoconnect is called. The reason i to allow for more
beautifull scheme-code:

(let* ((gui (glade-xml-new "gui.glade"))
       (foo-widget (glade-xml-get-widget gui "foo")))

  (define (button-bar-clicked)
    (gtk-widget-hide foo-widget))

  (glade-xml-signal-autoconnect gui)

  (gtk-standalone-main
   (glade-xml-get-widget gui "main-window")))


If glade-xml-signal-autoconnect where not to searrch the local closure,
the above code would have to be written as following (much less lispich in
my opinion):

(define gui (glade-xml-new "gui.glade"))
(define foo-widget (glade-xml-get-widget gui "foo"))

(define (button-bar-clicked)
  (gtk-widget-hide foo-widget))

(glade-xml-signal-autoconnect gui)

(gtk-standalone-main
 (glade-xml-get-widget gui "main-window"))

/Egil


P.S. By the way, where should one submit new guile wrapper modules, like
my guile-glade one?

-- 
http://redhog.org
GPG Public key: http://redhog.org/PGP%20Public%20key.asc
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!





reply via email to

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