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: how to define a transformer?


Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE> writes:

> > > However, the module system will change anyway [TM]. :)
> > I hope that comes before long...  
> 
> May happen in this century. :)  I'll post my module proposal
> in jun/jul this year.

Sounds great :)  One thing I worry about is when it is implemented
and actually included in the core.  Does Guile have a plan when it
includes GOOPS and the environment?  I think it would be great if
Guile 1.3.6 were released right now and all changes people have
discussed were implemented in this summer toward Guile 1.4 or,
possibly, Guile 2.0.  I'm going to work on a better support of
docstrings with Guile Emacs so that it becomes easier for people
to learn Guile Scheme.

> Hmm, I think you should insert a (let ((x (copy-tree x)))) before
> rewriting x.

I thought it were expensive...  Is there any problem with not doing it?

> Why so complicated anyway, doesn't a procedure with
> setter + some macro do what you want?

One reason I decided not to use procedure-with-setter is because Richard
Stallman and others do not like it:

Richard Stallman <rms@gnu.org> writes:

|       (import-lisp-variable user-full-name)
|       (set! (user-full-name) "Keisuke Nishida")
|       (insert (user-full-name))
| 
| I think it could be ok to require `import-lisp-variable' to make Lisp
| bindings accessible.  Once that is done, though, I think it would be
| cleaner to use an ordinary variable reference in Scheme rather that
| a function call.

And I agree with that.  However, since I have to call a function to
refer to a Lisp variable, it seems there is no way for me to do that.
(That's why I asked about the environment and indirect objects.)

Using eval-transformer, I could write Emacs Scheme programs like this:

  (set! $user-full-name "Keisuke Nishida")
  (insert $user-full-name)

I guess this is one natural way of writing the code in Emacs Scheme;
dynamic variables have to be explicitly dereferenced, and the syntax
is not like a function call.  Also, it is easier to rewrite the code
if it becomes necessary.

I'm also thinking of transforming the code

  window.buffer.name

into

  (buffer-name (window-buffer window))

but I'm not sure how worth it is.

-- Kei

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