prelude: :gerbil/core
package: gerbil/compiler
namespace: gxc

(%#begin (%#import
          :gerbil/core/expander
          :gerbil/expander
          :gerbil/compiler/base
          :gerbil/compiler/method
          :gerbil/compiler/compile
          :gerbil/compiler/optimize-base
          :gerbil/compiler/optimize-xform)
         (%#export #t)
         (%#define-runtime
          ::collect-top-level-type-info::t
          gxc#::collect-top-level-type-info::t)
         (%#define-runtime
          ::collect-top-level-type-info?
          gxc#::collect-top-level-type-info?)
         (%#define-runtime
          make-::collect-top-level-type-info
          gxc#make-::collect-top-level-type-info)
         (%#begin (%#begin-syntax
                   (%#call (%#ref load-module)
                           (%#quote "gerbil/compiler/optimize-top~1")))
                  (%#define-syntax
                   ::collect-top-level-type-info
                   |gxc[:0:]#::collect-top-level-type-info|))
         (%#define-runtime
          ::collect-top-level-type-info-bind-methods!
          gxc#::collect-top-level-type-info-bind-methods!)
         (%#define-runtime
          apply-collect-top-level-type-info
          gxc#apply-collect-top-level-type-info)
         (%#define-runtime
          ::collect-top-level-declarations::t
          gxc#::collect-top-level-declarations::t)
         (%#define-runtime
          ::collect-top-level-declarations?
          gxc#::collect-top-level-declarations?)
         (%#define-runtime
          make-::collect-top-level-declarations
          gxc#make-::collect-top-level-declarations)
         (%#define-syntax
          ::collect-top-level-declarations
          |gxc[:0:]#::collect-top-level-declarations|)
         (%#define-runtime
          ::collect-top-level-declarations-bind-methods!
          gxc#::collect-top-level-declarations-bind-methods!)
         (%#define-runtime
          apply-collect-top-level-declarations
          gxc#apply-collect-top-level-declarations)
         (%#define-runtime
          ::basic-expression-top-level-type::t
          gxc#::basic-expression-top-level-type::t)
         (%#define-runtime
          ::basic-expression-top-level-type?
          gxc#::basic-expression-top-level-type?)
         (%#define-runtime
          make-::basic-expression-top-level-type
          gxc#make-::basic-expression-top-level-type)
         (%#define-syntax
          ::basic-expression-top-level-type
          |gxc[:0:]#::basic-expression-top-level-type|)
         (%#define-runtime
          ::basic-expression-top-level-type-bind-methods!
          gxc#::basic-expression-top-level-type-bind-methods!)
         (%#define-runtime
          apply-basic-expression-top-level-type
          gxc#apply-basic-expression-top-level-type)
         (%#define-runtime ::collect-type-info::t gxc#::collect-type-info::t)
         (%#define-runtime ::collect-type-info? gxc#::collect-type-info?)
         (%#define-runtime
          make-::collect-type-info
          gxc#make-::collect-type-info)
         (%#define-syntax ::collect-type-info |gxc[:0:]#::collect-type-info|)
         (%#define-runtime
          ::collect-type-info-bind-methods!
          gxc#::collect-type-info-bind-methods!)
         (%#define-runtime apply-collect-type-info gxc#apply-collect-type-info)
         (%#define-runtime
          ::collect-mutable-type-info::t
          gxc#::collect-mutable-type-info::t)
         (%#define-runtime
          ::collect-mutable-type-info?
          gxc#::collect-mutable-type-info?)
         (%#define-runtime
          make-::collect-mutable-type-info
          gxc#make-::collect-mutable-type-info)
         (%#define-syntax
          ::collect-mutable-type-info
          |gxc[:0:]#::collect-mutable-type-info|)
         (%#define-runtime
          ::collect-mutable-type-info-bind-methods!
          gxc#::collect-mutable-type-info-bind-methods!)
         (%#define-runtime
          apply-collect-mutable-type-info
          gxc#apply-collect-mutable-type-info)
         (%#define-runtime ::refine-type-info::t gxc#::refine-type-info::t)
         (%#define-runtime ::refine-type-info? gxc#::refine-type-info?)
         (%#define-runtime make-::refine-type-info gxc#make-::refine-type-info)
         (%#define-syntax ::refine-type-info |gxc[:0:]#::refine-type-info|)
         (%#define-runtime
          ::refine-type-info-bind-methods!
          gxc#::refine-type-info-bind-methods!)
         (%#define-runtime apply-refine-type-info gxc#apply-refine-type-info)
         (%#define-runtime
          ::raw-expression-type::t
          gxc#::raw-expression-type::t)
         (%#define-runtime ::raw-expression-type? gxc#::raw-expression-type?)
         (%#define-runtime
          make-::raw-expression-type
          gxc#make-::raw-expression-type)
         (%#define-syntax
          ::raw-expression-type
          |gxc[:0:]#::raw-expression-type|)
         (%#define-runtime
          ::raw-expression-type-bind-methods!
          gxc#::raw-expression-type-bind-methods!)
         (%#define-runtime
          apply-raw-expression-type
          gxc#apply-raw-expression-type)
         (%#define-runtime
          ::basic-expression-type::t
          gxc#::basic-expression-type::t)
         (%#define-runtime
          ::basic-expression-type?
          gxc#::basic-expression-type?)
         (%#define-runtime
          make-::basic-expression-type
          gxc#make-::basic-expression-type)
         (%#define-syntax
          ::basic-expression-type
          |gxc[:0:]#::basic-expression-type|)
         (%#define-runtime
          ::basic-expression-type-bind-methods!
          gxc#::basic-expression-type-bind-methods!)
         (%#define-runtime
          apply-basic-expression-type
          gxc#apply-basic-expression-type)
         (%#define-runtime ::lift-top-lambdas::t gxc#::lift-top-lambdas::t)
         (%#define-runtime ::lift-top-lambdas? gxc#::lift-top-lambdas?)
         (%#define-runtime make-::lift-top-lambdas gxc#make-::lift-top-lambdas)
         (%#define-syntax ::lift-top-lambdas |gxc[:0:]#::lift-top-lambdas|)
         (%#define-runtime
          ::lift-top-lambdas-bind-methods!
          gxc#::lift-top-lambdas-bind-methods!)
         (%#define-runtime apply-lift-top-lambdas gxc#apply-lift-top-lambdas)
         (%#define-runtime
          ::extract-lambda-signature::t
          gxc#::extract-lambda-signature::t)
         (%#define-runtime
          ::extract-lambda-signature?
          gxc#::extract-lambda-signature?)
         (%#define-runtime
          make-::extract-lambda-signature
          gxc#make-::extract-lambda-signature)
         (%#define-syntax
          ::extract-lambda-signature
          |gxc[:0:]#::extract-lambda-signature|)
         (%#define-runtime
          ::extract-lambda-signature-bind-methods!
          gxc#::extract-lambda-signature-bind-methods!)
         (%#define-runtime
          apply-extract-lambda-signature
          gxc#apply-extract-lambda-signature)
         (%#define-runtime
          collect-top-level-type-define-values%
          gxc#collect-top-level-type-define-values%)
         (%#define-runtime
          collect-top-level-decl-begin-annotation%
          gxc#collect-top-level-decl-begin-annotation%)
         (%#define-runtime eval-in-ssxi-context gxc#eval-in-ssxi-context)
         (%#define-runtime
          collect-type-define-values%
          gxc#collect-type-define-values%)
         (%#define-runtime
          collect-type-begin-annotation%
          gxc#collect-type-begin-annotation%)
         (%#define-runtime collect-type-lambda% gxc#collect-type-lambda%)
         (%#define-runtime
          collect-type-case-lambda%
          gxc#collect-type-case-lambda%)
         (%#define-runtime
          collect-type-lambda-formals-tail
          gxc#collect-type-lambda-formals-tail)
         (%#begin (%#define-runtime
                   collect-type-let-values%__%
                   gxc#collect-type-let-values%__%)
                  (%#begin (%#define-runtime
                            collect-type-let-values%__0
                            gxc#collect-type-let-values%__0)
                           (%#define-runtime
                            collect-type-let-values%
                            gxc#collect-type-let-values%)))
         (%#begin (%#define-runtime
                   collect-type-letrec-values%__%
                   gxc#collect-type-letrec-values%__%)
                  (%#begin (%#define-runtime
                            collect-type-letrec-values%__0
                            gxc#collect-type-letrec-values%__0)
                           (%#define-runtime
                            collect-type-letrec-values%
                            gxc#collect-type-letrec-values%)))
         (%#define-runtime
          collect-top-level-type-let-values%
          gxc#collect-top-level-type-let-values%)
         (%#define-runtime
          collect-top-level-type-letrec-values%
          gxc#collect-top-level-type-letrec-values%)
         (%#define-runtime
          collect-top-level-type-call%
          gxc#collect-top-level-type-call%)
         (%#define-runtime collect-type-setq% gxc#collect-type-setq%)
         (%#define-runtime apply-path-type-if% gxc#apply-path-type-if%)
         (%#define-runtime
          refine-type-define-values%
          gxc#refine-type-define-values%)
         (%#define-runtime refine-type-let-values% gxc#refine-type-let-values%)
         (%#define-runtime
          refine-type-letrec-values%
          gxc#refine-type-letrec-values%)
         (%#define-runtime refine-type-lambda% gxc#refine-type-lambda%)
         (%#define-runtime
          refine-type-case-lambda%
          gxc#refine-type-case-lambda%)
         (%#define-runtime
          basic-expression-type-annotations
          gxc#basic-expression-type-annotations)
         (%#define-syntax
          defbasic-expression-type-annotations
          |gxc[:0:]#defbasic-expression-type-annotations|)
         (%#define-runtime
          basic-expression-type-begin-annotation%
          gxc#basic-expression-type-begin-annotation%)
         (%#define-runtime
          basic-expression-type-annotation-typedecl
          gxc#basic-expression-type-annotation-typedecl)
         (%#define-runtime
          basic-expression-type-annotation-mop.class
          gxc#basic-expression-type-annotation-mop.class)
         (%#define-runtime
          basic-expression-type-annotation-mop.system
          gxc#basic-expression-type-annotation-mop.system)
         (%#define-runtime
          basic-expression-type-annotation-mop.constructor
          gxc#basic-expression-type-annotation-mop.constructor)
         (%#define-runtime
          basic-expression-type-annotation-mop.predicate
          gxc#basic-expression-type-annotation-mop.predicate)
         (%#define-runtime
          basic-expression-type-annotation-mop.accessor
          gxc#basic-expression-type-annotation-mop.accessor)
         (%#define-runtime
          basic-expression-type-annotation-mop.mutator
          gxc#basic-expression-type-annotation-mop.mutator)
         (%#define-runtime
          basic-expression-type-annotation-interface
          gxc#basic-expression-type-annotation-interface)
         (%#define-runtime
          basic-expression-type-annotation-predicate
          gxc#basic-expression-type-annotation-predicate)
         (%#define-runtime
          basic-expression-type-annotation-abort
          gxc#basic-expression-type-annotation-abort)
         (%#define-runtime
          raw-expression-type-lambda%
          gxc#raw-expression-type-lambda%)
         (%#define-runtime
          basic-expression-type-lambda%
          gxc#basic-expression-type-lambda%)
         (%#define-runtime
          basic-expression-type-case-lambda%
          gxc#basic-expression-type-case-lambda%)
         (%#define-runtime
          basic-expression-type-special
          gxc#basic-expression-type-special)
         (%#define-syntax
          defbasic-expression-type-special
          |gxc[:0:]#defbasic-expression-type-special|)
         (%#define-runtime
          basic-expression-type-call%
          gxc#basic-expression-type-call%)
         (%#define-runtime !procedure::return-type gxc#!procedure::return-type)
         (%#define-runtime
          !procedure::apply-return-type
          gxc#!procedure::apply-return-type)
         (%#define-runtime !lambda::return-type gxc#!lambda::return-type)
         (%#define-runtime
          !lambda::apply-return-type
          gxc#!lambda::apply-return-type)
         (%#define-runtime
          !case-lambda::return-type
          gxc#!case-lambda::return-type)
         (%#define-runtime
          !case-lambda::apply-return-type
          gxc#!case-lambda::apply-return-type)
         (%#define-runtime !kw-lambda::return-type gxc#!kw-lambda::return-type)
         (%#define-runtime
          !kw-lambda::apply-return-type
          gxc#!kw-lambda::apply-return-type)
         (%#define-runtime extract-keyword-args gxc#extract-keyword-args)
         (%#define-runtime !lambda-arity-match? gxc#!lambda-arity-match?)
         (%#define-runtime
          !lambda-arity-match-apply?
          gxc#!lambda-arity-match-apply?)
         (%#define-runtime
          basic-expression-type-special-cast
          gxc#basic-expression-type-special-cast)
         (%#define-runtime
          basic-expression-type-special-apply
          gxc#basic-expression-type-special-apply)
         (%#define-runtime
          basic-expression-type-ref%
          gxc#basic-expression-type-ref%)
         (%#define-runtime
          basic-expression-type-if%
          gxc#basic-expression-type-if%)
         (%#define-runtime greatest-common-type gxc#greatest-common-type)
         (%#define-runtime
          basic-expression-type-quote%
          gxc#basic-expression-type-quote%)
         (%#define-runtime dispatch-lambda-form? gxc#dispatch-lambda-form?)
         (%#define-runtime
          dispatch-lambda-form-delegate
          gxc#dispatch-lambda-form-delegate)
         (%#define-runtime lambda-form-arity gxc#lambda-form-arity)
         (%#define-runtime
          lambda-form-infer-signature
          gxc#lambda-form-infer-signature)
         (%#define-runtime
          extract-lambda-signature-begin-annotation%
          gxc#extract-lambda-signature-begin-annotation%)
         (%#define-runtime lambda-expr? gxc#lambda-expr?)
         (%#define-runtime case-lambda-expr? gxc#case-lambda-expr?)
         (%#define-runtime opt-lambda-expr? gxc#opt-lambda-expr?)
         (%#define-runtime kw-lambda-expr? gxc#kw-lambda-expr?)
         (%#begin (%#define-runtime
                   lift-case-lambda-clauses__%
                   gxc#lift-case-lambda-clauses__%)
                  (%#begin (%#define-runtime
                            lift-case-lambda-clauses__0
                            gxc#lift-case-lambda-clauses__0)
                           (%#define-runtime
                            lift-case-lambda-clauses
                            gxc#lift-case-lambda-clauses)))
         (%#define-runtime
          lift-top-lambda-define-values%
          gxc#lift-top-lambda-define-values%)
         (%#define-runtime
          lift-top-lambda-let-values%
          gxc#lift-top-lambda-let-values%)
         (%#define-runtime
          lift-top-lambda-letrec-values%
          gxc#lift-top-lambda-letrec-values%)
         (%#define-runtime
          lift-top-lambda-binding?
          gxc#lift-top-lambda-binding?))
(%#call (%#ref load-module) (%#quote "gerbil/compiler/optimize-top~0"))
