[<<][staapl][>>][..]
Wed Jul 22 12:32:40 CEST 2009

dfl-compose without eval

(define-syntax (dfl-compose stx)
  (syntax-case stx ()
    ((_ formals body ...)
     (let-staged ((nodes (dfl-graph formals body ...))) ;; (*)
         #`'(dfl-sequence
             formals
             #,(dfl-sort-graph
                nodes
                (syntax->list #'(body ...))))))))

;; The construct(*) behaves as:
;;
;;    (let ((nodes (eval #'(dfl-graph formals body ...)))) ___)
;;
;; but doesn't use `eval'.  Instead it uses a 2nd macro stage to
;; trigger evaluation of the syntax form.  The function
;; `dfl-sort-graph' takes both a syntax and a value `nodes' derived
;; from it and produces a sorted program.



[Reply][About]
[<<][staapl][>>][..]