This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tie variable


On Tue, Mar 14, 2000 at 04:52:50AM -0500, Keisuke Nishida wrote:
> 
>   (define user-full-name (global-variable 'user-full-name))

In the final version, you will provide a macro to do this,
won't you? Let the user think he's doing something like
   (import-variable user-full-name)


>   (global-ref user-full-name)
>   (global-set! user-full-name value)
> 
> But this is rather tedious.  I'd like to write:
> 
>   user-full-name
>   (set! user-full-name value)

One way to make set! work is with GOOPS and generics.

(define-method set! ((var <emacs-variable>) value)
    (global-set! var value))

(or something, I'm too tired to check)

GOOPS can probably give some way out for getting the value too,
it's worth checking.

[]s,
                                               |alo
                                               +----
--
          Hack and Roll  ( http://www.hackandroll.org )
            News for, uh, whatever it is that we are.


http://www.webcom.com/lalo           mailto:lalo@hackandroll.org
                 pgp key in the personal page

Debian GNU/Linux            ---            http://www.debian.org
Brazil of Darkness        ---       http://zope.gf.com.br/BroDar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]