folks, the `with-excursion-function' macro seems to be bolted-on to module (ice-9 calling). here is how to use it:
(define a 42) (define c 999) (define (spew!) (write-line (list #:a a #:c c))) (with-excursion-function (a c) (lambda (ex) (ex (lambda () (spew!) (set! a 0) (set! c -1) (spew!))))) the call site seems to be rather convoluted, compared to: (define-macro (save-bindings-excursion vars . body) (let ((saved-value-names (map (lambda ignored (gensym)) vars)) (tmp-var-name (gensym)) (swap-fn-name (gensym))) `(let ((,tmp-var-name #f) ,@(map list saved-value-names vars)) (define (,swap-fn-name) ,@(apply append (map (lambda (n sn) `((set! ,tmp-var-name ,n) (set! ,n ,sn) (set! ,sn ,tmp-var-name))) vars saved-value-names))) (dynamic-wind ,swap-fn-name (lambda () ,@body) ,swap-fn-name)))) (save-bindings-excursion (a c) (spew!) (set! a 0) (set! c -1) (spew!)) so i wonder: can anyone show code that uses `with-excursion-function'? google does not reveal any usage, and the ice-9 doc by Tom Lord ~1999 does not mention it, either. thi _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user