Committed revision 248 to http://bzr.xsteve.at/dvc/

Merged from Michael Olson: Overhauled dvc-lisp.el
    ------------------------------------------------------------
    revno: 241.1.18
    merged: [EMAIL PROTECTED]
    committer: Michael W. Olson <[EMAIL PROTECTED]>
    branch nick: mwolson
    timestamp: Mon 2007-09-03 23:21:47 -0400
    message:
      Fix bug introduced in last patch
    ------------------------------------------------------------
    revno: 241.1.17
    merged: [EMAIL PROTECTED]
    committer: Michael W. Olson <[EMAIL PROTECTED]>
    branch nick: mwolson
    timestamp: Mon 2007-09-03 23:19:04 -0400
    message:
      Minor docfix for dvc-gensym
      
      * lisp/dvc-lisp.el (dvc-gensym): Minor docfix.
    ------------------------------------------------------------
    revno: 241.1.16
    merged: [EMAIL PROTECTED]
    committer: Michael W. Olson <[EMAIL PROTECTED]>
    branch nick: mwolson
    timestamp: Mon 2007-09-03 15:38:42 -0400
    message:
      Rework dvc-capturing-lambda to not depend on lexical behavior from the 
Emacs `let' form
      
      * lisp/dvc-lisp.el (dvc-capturing-lambda-helper): Explain
        `captured-symbols'.
        (dvc-capturing-lambda): Re-make and test.  This removes my grievance
        about the unnecessary (funcall (lambda () ...)) form at the end.
        Further explanation below.
      
      I noticed that the `sort-by-nearness-1' example that I gave in the
      documentation for dvc-capturing-lambda caused a warning about "a" being
      undefined when byte-compiling.  This was due to the code generating a
      let-bind around a lambda, which is completely incorrect in Emacs Lisp:
      that construct assumes lexical binding, which we don't have.
      
      The best way of doing this is to instead pass extra arguments to a new
      lambda form.  This way, we guarantee that the necessary bindings exist
      inside of the lambda form.  We use the newly generated symbol names as
      the names of these "extra" arguments, and preserve the names of the real
      arguments which are in the outer lambda form.
      
      To illustrate, the old way generated code similar in effect to this:
      
      [Assume the statements (capture sym1) and (capture sym2) exist in body,
      and that these symbols have been replaced with dvc-uniq-1 and dvc-uniq-2
      in body, respectively.]
      
      `(lambda (arg1 arg2)
        (let ((dvc-uniq-1 ,sym1)
              (dvc-uniq-2 ,sym2))
          (funcall (lambda () body))))
      
      The new way is to generate code like the following, instead:
      
      `(lambda (arg1 arg2)
         (apply (lambda (arg1 arg2 dvc-uniq-1 dvc-uniq-2) body)
                arg1 arg2
                '(,sym1 ,sym2)))
      
      This code has passed all of the tests that I have thrown at it (both
      byte-compiled and interpreted), so I am certain that it works.
    ------------------------------------------------------------
    revno: 241.1.15
    merged: [EMAIL PROTECTED]
    committer: Michael W. Olson <[EMAIL PROTECTED]>
    branch nick: mwolson
    timestamp: Mon 2007-09-03 13:11:59 -0400
    message:
      dvc-lisp: Improve documentation
      
      * lisp/dvc-lisp.el: Improve documentation.  Make eval-and-compile only
        happen around dvc-capturing-lambda macro.

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to