This is the mail archive of the guile-emacs@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]

pass by value / pass by reference


Hello,

One problem of my current implementation is that whenever one
interpreter calls the other one, the arguments are converted
into the other type; that is, they are passed by value.  This
works fine for some cases, but sometimes it is necessary to pass
them by reference.

Using some tricks, our Scheme files may look like this:

  ;; Import a variable from the lisp world.
  (import-lisp-variable user-full-name)

  ;; Get the value of variable by value.
  (define name (user-full-name))

  ;; Set the value of varialbe
  (set! (user-full-name) name)

  ;; Call a Lisp function with the reference of variable
  (insert user-full-name)

This looks nice and natural, but I wonder if this code can be used
in the future with the real Guile-based Emacs, where all values are
references...

But I guess this is an unavoidable drawback of my approach.
I have to do this in any event.  I understand I'm doing a bad thing...

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