Next: , Up: expander examples   [Index]


15.8.1 Prelude and postlude

All the examples are given as executable code, but when the output of the pretty printer is shown: it is edited for readability.

Unless otherwise specified, all the examples are R6RS programs, starting with the prelude:

(import (vicare)
  (prefix (vicare expander) xp::))

(begin-for-syntax

  (define (id->label id)
    (xp::syntactic-identifier->label id))

  (define (label->descriptor lab)
    (xp::label->syntactic-binding-descriptor lab
      (xp::current-inferior-lexenv)))

  (define (id->descriptor id)
    (label->descriptor (id->label id)))

  (define (id-rib*/no-top id)
    (reverse (cdr (reverse (xp::stx-rib* id)))))

  (define (eq-ribs? id1 id2)
    (eq? (xp::stx-rib* id1) (xp::stx-rib* id2)))

  #| end of BEGIN-FOR-SYNTAX |# )

and ending with the postlude:

(begin-for-syntax
  (flush-output-port (current-output-port)))
(flush-output-port (current-output-port))