|(require mzlib/etc)||package: compatibility-lib|
(begin-lifted expr ...+)
Lifts the exprs so that they are evaluated once at the “top level” of the current context, and the result of the last expr is used for every evaluation of the begin-lifted form.
When this form is used as a run-time expression within a module, the “top level” corresponds to the module’s top level, so that each expr is evaluated once for each invocation of the module. When it is used as a run-time expression outside of a module, the “top level” corresponds to the true top level. When this form is used in a define-syntax, letrec-syntax, etc. binding, the “top level” corresponds to the beginning of the binding’s right-hand side. Other forms may redefine “top level” (using local-expand/capture-lifts) for the expressions that they enclose.
(begin-with-definitions defn-or-expr ...)
(define-syntax-set (id ...) defn ...)
(define-syntax-set (let-current-continuation let-current-escape-continuation) (define (mk call-id) (lambda (stx) (syntax-case stx () [(_ id body1 body ...) (with-syntax ([call call-id]) #'(call (lambda (id) body1 body ...)))]))) (define let-current-continuation/proc (mk (quote-syntax call/cc))) (define let-current-escape-continuation/proc (mk (quote-syntax call/ec))))
(identity v) → any/c
v : any/c
Each clause has one of the following forms:
(val target expr) : Binds target non-recursively to expr.
(rec target expr) : Binds target recursively to expr.
(vals (target expr) ...) : The targets are bound to the exprs. The environment of the exprs is the environment active before this clause.
(recs (target expr) ...) : The targetss are bound to the exprs. The environment of the exprs includes all of the targetss.
(_ expr ...) : Evaluates the exprs without binding any variables.
start : any/c done? : (any/c . -> . any) next : (any/c . -> . any/c) f : (any/c . -> . any)
(define (loop-until start done? next f) (let loop ([i start]) (unless (done? i) (f i) (loop (next i)))))
(nand expr ...)
(nor expr ...)
(opt-lambda formals body ...+)
(recur id bindings body ...+)
(letrec ([id value-expr]) id) (letrec ([id (lambda (arg-id ...) value-expr)]) id) (letrec ([id (lambda (arg-id ... . rest-id) value-expr)]) id)
See scheme/runtime-path for a definition form that works better when creating executables.
Expands to an expression that evaluates to the directory of the file containing the source datum. If datum is not supplied, then the entire (this-expression-source-directory) expression is used as datum.
If datum has a source module, then the expansion attempts to determine the module’s run-time location. This location is determined by preserving the lexical context of datum in a syntax object, extracting its source module path at run time, and then resolving the module path.
Otherwise, datum’s source file is determined through source location information associated with datum, if it is present. As a last resort, current-load-relative-directory is used if it is not #f, and current-directory is used if all else fails.
A directory path derived from source location is always stored in bytes in the expanded code, unless the file is within the result of find-collects-dir, in which case the expansion records the path relative to (find-collects-dir) and then reconstructs it using (find-collects-dir) at run time.