guile-devel
[Top][All Lists]
Advanced

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

Re: @bind


From: Neil Jerram
Subject: Re: @bind
Date: 07 Sep 2001 10:21:02 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Thien-Thi" == Thien-Thi Nguyen <address@hidden> writes:

    Thien-Thi> how would this affect line/column source properties?  i
    Thien-Thi> suppose that's a lower priority issue.

Right now, I'm not getting source properties for elisp code at all.  I
think this is either because I'm doing the loading incorrectly, or
because I'm losing the properties in the transformer by not using
`cons-source'.  Perhaps this is what Mikael meant by his comment
"Should be made mutating instead of constructing".  This is definitely
something that I'd like to fix, mostly for the advantage that source
properties give you in debugging.

    Thien-Thi> btw, which form did you run into this problem w/?

It was one of the defsubsts in subr.el.  For example:

(defsubst caar (x)
  "Return the car of the car of X."
  (car (car x)))

where `defsubst' has already been defined as a defmacro in
byte-run.el.  Before, this was transformed to:

(@fop defsubst caar (@fop x)
  "Return the car of the car of X."
  (@fop car (@fop car x)))

and then `caar' ends up being defined as a macro that expects two
args, address@hidden' and `x'.

Now, it is transformed to

(@fop defsubst
      (#<macro transformer-macro> caar (x)
                                  "Return the car of the car of X."
                                  (car (car x))))

but when @fop is evaluated, it notices that `defsubst' is a macro and
so cuts the #<macro transformer-macro> out, returning

(#<macro defsubst> caar (x)
                   "Return the car of the car of X."
                   (car (car x)))

Then #<macro defsubst> does its transformation, which consists of the
elisp definition plus (lang elisp-transform) transformation of the
resulting elisp form, and finally the result is evaluated!

For completeness...  If `defsubst' was a function instead, then the
effect of @fop is to leave the #<macro transformer-macro> in place,
and to replace itself by SCM_IM_APPLY, so you get

(address@hidden #<procedure defsubst>
         (#<macro transformer-macro> caar (x)
                                     "Return the car of the car of X."
                                     (car (car x))))

In this case, evaluation of the (#<macro transformer-macro> ...)
expression produces a list of arguments that have been both
transformed and evaluated.

        Thanks for your interest.  By the way, do you think
        it would be a good idea for me to use your (ttn
        gap-buffer) as a proof of concept implementation of the
        buffer primitives?

    Thien-Thi> i think that's a great idea as a test of that module.
    Thien-Thi> you can even use some of (ttn edit).  i'm glad to tweak
    Thien-Thi> either one to make them useful to this effort.

Great; I'll try it out and let you know how that goes then.

        Neil




reply via email to

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