This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

reverse execution order in macro


Example of macro:

(define-syntax with-finalize
  (lambda (stx)
    (syntax-case stx ()
      ((_ ((var empty-value init-value finalizer) ... ) . body)
       (syntax
         (let ((var empty-value) ...)
           (try-finally
            (begin (set! var init-value) ...  . body)
            (begin (finalizer var) ... ))))))))

There must be a reverse order call of finalizers.
How it made?

I think nested `let are poorly suited in this - it is generate nested
try-finally.

Thanks!

-- 
WBR, Yaroslav Kavenchuk.


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