On this page:
top
up

2Syntax Object HelpersπŸ”— i

2.1Deconstructing Syntax ObjectsπŸ”— i

(require syntax/stx ) package: base

procedure

( stx-null? v)boolean?

v:any/c
Returns #t if v is either the empty list or a syntax object representing the empty list (i.e., syntax-e on the syntax object returns the empty list).

Examples:

#t

> (stx-null? #'())

#t

> (stx-null? #'(a))

#f

procedure

( stx-pair? v)boolean?

v:any/c
Returns #t if v is either a pair or a syntax object representing a pair (see syntax pair).

Examples:
> (stx-pair? (cons #'a#'b))

#t

> (stx-pair? #'(a. b))

#t

> (stx-pair? #'())

#f

> (stx-pair? #'a)

#f

procedure

( stx-list? v)boolean?

v:any/c
Returns #t if v is a list, or if it is a sequence of pairs leading to a syntax object such that syntax->list would produce a list.

Examples:
> (stx-list? #'(abcd))

#t

> (stx-list? #'((ab)(cd)))

#t

> (stx-list? #'(ab(cd)))

#t

> (stx-list? (list #'a#'b))

#t

> (stx-list? #'a)

#f

procedure

( stx->list stx-list)(or/c list? #f)

stx-list:stx-list?
Produces a list by flatting out a trailing syntax object using syntax->list .

Examples:
> (stx->list #'(abcd))

'(#<syntax:eval:14:0 a>

#<syntax:eval:14:0 b>

#<syntax:eval:14:0 c>

#<syntax:eval:14:0 d>)

> (stx->list #'((ab)(cd)))

'(#<syntax:eval:15:0 (a b)> #<syntax:eval:15:0 (c d)>)

> (stx->list #'(ab(cd)))

'(#<syntax:eval:16:0 a> #<syntax:eval:16:0 b> #<syntax:eval:16:0 (c d)>)

> (stx->list (list #'a#'b))

'(#<syntax:eval:17:0 a> #<syntax:eval:17:0 b>)

> (stx->list #'a)

#f

procedure

( stx-car v)any

Takes the car of a syntax pair.

Examples:
> (stx-car #'(ab))

#<syntax:eval:19:0 a>

> (stx-car (list #'a#'b))

#<syntax:eval:20:0 a>

procedure

( stx-cdr v)any

Takes the cdr of a syntax pair.

Examples:
> (stx-cdr #'(ab))

'(#<syntax:eval:21:0 b>)

> (stx-cdr (list #'a#'b))

'(#<syntax:eval:22:0 b>)

procedure

( stx-map procstxl...)list?

proc:procedure?
stxl:stx-list?
Equivalent to (map proc(stx->list stxl)... ).

Example:
> (stx-map (λ (id)(free-identifier=? id#'a))#'(abcd))

'(#t #f #f #f)

procedure

( module-or-top-identifier=? a-idb-id)boolean?

Returns #t if a-id and b-id are free-identifier=? , or if a-id and b-id have the same name (as extracted by syntax-e ) and a-id has no binding other than at the top level.

This procedure is useful in conjunction with syntax-case* to match procedure names that are normally bound by Racket. For example, the include macro uses this procedure to recognize build-path ; using free-identifier=? would not work well outside of module , since the top-level build-path is a distinct variable from the racket/base export (though it’s bound to the same procedure, initially).

2.2Matching Fully-Expanded ExpressionsπŸ”— i

syntax

( kernel-syntax-case stx-exprtrans?-exprclause...)

A syntactic form like syntax-case* , except that the literals are built-in as the names of the primitive Racket forms as exported by racket/base, including letrec-syntaxes+values ; see Fully Expanded Programs.

The trans?-expr boolean expression replaces the comparison procedure, and instead selects simply between normal-phase comparisons or transformer-phase comparisons. The clauses are the same as in syntax-case* .

The primitive syntactic forms must have their normal bindings in the context of the kernel-syntax-case expression. Beware that kernel-syntax-case does not work in a module whose language provides different bindings for these primitive syntactic forms, such as mzscheme which does not provide the primitive if and typed/racket which does not provide the primitive let-values among others.

syntax

( kernel-syntax-case* stx-exprtrans?-expr(extra-id...)clause...)

A syntactic form like kernel-syntax-case , except that it takes an additional list of extra literals that are in addition to the primitive Racket forms.

syntax

( kernel-syntax-case/phase stx-exprphase-exprclause...)

Generalizes kernel-syntax-case to work at an arbitrary phase level, as indicated by phase-expr.

syntax

( kernel-syntax-case*/phase stx-exprphase-expr(extra-id..)
clause...)
Generalizes kernel-syntax-case* to work at an arbitrary phase level, as indicated by phase-expr.

Returns a list of identifiers that are bound normally, for-syntax , and for-template to the primitive Racket forms for expressions, internal-definition positions, and module-level and top-level positions. This function is useful for generating a list of stopping points to provide to local-expand .

In addition to the identifiers listed in Fully Expanded Programs, the list includes letrec-syntaxes+values , which is the core form for local expand-time binding and can appear in the result of local-expand .

Changed in version 6.90.0.27 of package base: Added quote-syntax and #%plain-module-begin to the list, which had previously been unintentionally missing.

2.3Dictionaries with Identifier KeysπŸ”— i

This module provides two implementations of identifier tables: dictionaries with identifier keys that use identifier-specific comparisons instead of eq? or equal? . Identifier tables implement the racket/dict interface, and they are available in both mutable and immutable variants.

2.3.1Dictionaries for free-identifier=? πŸ”— i

A free-identifier table is a dictionary whose keys are compared using free-identifier=? . Free-identifier tables implement the dictionary interface of racket/dict, so all of the appropriate generic functions (dict-ref , dict-map , etc) can be used on free-identifier tables.

A caveat for using these tables is that a lookup can fail with unexpected results if the binding of an identifier changes between key-value insertion and the lookup.

For example, consider the following use:

;set table entry to #t
(free-id-table-set! table#'x#t)
;sanity check, it's set to #t
(displayln (free-id-table-ref table#'x#f)))
(define x'defined-now)
;might expect to get #t, but prints #f
(displayln (free-id-table-ref table#'x#f)))))
> (m)

#t

#f

The macro m expands to code that initializes an identifier table at compile-time and inserts a key-value pair for #'x and #t. The #'x identifier has no binding, however, until the definition (define x'defined-now) is evaluated.

As a result, the lookup at the end of m will return #f instead of #t because the binding symbol for #'x changes after the initial key-value pair is put into the table. If the definition is evaluated before the initial insertion, both expressions will print #t.

procedure

( make-free-id-table [ init-dict
#:phasephase])mutable-free-id-table?
init-dict:dict? =null

procedure

#:phasephase])
init-dict:dict? =null
Produces a mutable free-identifier table or immutable free-identifier table, respectively. The dictionary uses free-identifier=? to compare keys, but also uses a hash table based on symbol equality to make the dictionary efficient in the common case.

The identifiers are compared at phase level phase. The default phase, (syntax-local-phase-level ), is generally appropriate for identifier tables used by macros, but code that analyzes fully-expanded programs may need to create separate identifier tables for each phase of the module.

The optional init-dict argument provides the initial mappings. It must be a dictionary, and its keys must all be identifiers. If the init-dict dictionary has multiple distinct entries whose keys are free-identifier=? , only one of the entries appears in the new id-table, and it is not specified which entry is picked.

procedure

( free-id-table? v)boolean?

v:any/c
Returns #t if v was produced by make-free-id-table or make-immutable-free-id-table , #f otherwise.

Returns #t if v was produced by make-free-id-table , #f otherwise.

Returns #t if v was produced by make-immutable-free-id-table , #f otherwise.

procedure

( free-id-table-ref tableid[failure])any

failure:any/c =(lambda ()(raise (make-exn:fail .....)))
Like hash-ref . In particular, if id is not found, the failure argument is applied if it is a procedure, or simply returned otherwise.

procedure

( free-id-table-ref! tableidfailure)any

failure:any/c
Like hash-ref! .

Added in version 6.3.0.6 of package base.

Like hash-set! .

Like hash-set .

procedure

( free-id-table-set*! tableidv......)void?

v:any/c
Like hash-set*! .

Added in version 6.3.0.6 of package base.

Like hash-set* .

Added in version 6.3.0.6 of package base.

procedure

id
updater
[ failure])void?
updater:(any/c . -> .any/c )
failure:any/c =(lambda ()(raise (make-exn:fail .....)))

Added in version 6.3.0.6 of package base.

procedure

id
updater
[ failure])immutable-free-id-table?
updater:(any/c . -> .any/c )
failure:any/c =(lambda ()(raise (make-exn:fail .....)))

Added in version 6.3.0.6 of package base.

procedure

( free-id-table-map tableproc)list?

Like hash-map .

procedure

( free-id-table-keys table)(listof identifier? )

Like hash-keys .

Added in version 6.3.0.3 of package base.

procedure

( free-id-table-values table)(listof any/c )

Added in version 6.3.0.3 of package base.

procedure

( in-free-id-table table)sequence?

Like in-hash .

Added in version 6.3.0.3 of package base.

procedure

( free-id-table-for-each tableproc)void?

Like hash-count .

procedure

( free-id-table-iterate-next tableposition)id-table-iter?

position:id-table-iter?

procedure

( free-id-table-iterate-key tableposition)identifier?

position:id-table-iter?

procedure

position)identifier?
table:bound-it-table?
position:id-table-iter?

procedure

( id-table-iter? v)boolean?

v:any/c
Returns #t if v represents a position in an identifier table (free or bound, mutable or immutable), #f otherwise.

procedure

( free-id-table/c key-ctc
val-ctc
[ #:immutableimmutable?])contract?
key-ctc:flat-contract?
immutable?:(or/c #t#f'dont-care)='dont-care
Like hash/c , but for free-identifier tables. If immutable? is #t, the contract accepts only immutable identifier tables; if immutable? is #f, the contract accepts only mutable identifier tables.

2.3.2Dictionaries for bound-identifier=? πŸ”— i

A bound-identifier table is a dictionary whose keys are compared using bound-identifier=? . Bound-identifier tables implement the dictionary interface of racket/dict, so all of the appropriate generic functions (dict-ref , dict-map , etc) can be used on bound-identifier tables.

procedure

( make-bound-id-table [ init-dict
#:phasephase])mutable-bound-id-table?
init-dict:dict? =null

procedure

#:phasephase])
init-dict:dict? =null

procedure

( bound-id-table? v)boolean?

v:any/c

procedure

( bound-id-table-ref tableid[failure])any

failure:any/c =(lambda ()(raise (make-exn:fail .....)))

procedure

( bound-id-table-ref! tableidfailure)any

failure:any/c

procedure

( bound-id-table-set*! tableidv......)void?

v:any/c

procedure

id
updater
[ failure])void?
updater:(any/c . -> .any/c )
failure:any/c =(lambda ()(raise (make-exn:fail .....)))

procedure

id
updater
[ failure])immutable-bound-id-table?
updater:(any/c . -> .any/c )
failure:any/c =(lambda ()(raise (make-exn:fail .....)))

procedure

( bound-id-table-map tableproc)list?

procedure

( bound-id-table-keys table)(listof identifier? )

procedure

( bound-id-table-values table)(listof any/c )

procedure

( in-bound-id-table table)sequence?

procedure

( bound-id-table-for-each tableproc)void?

procedure

( bound-id-table-iterate-first table)id-table-position?

procedure

position)id-table-position?
position:id-table-position?

procedure

( bound-id-table-iterate-key tableposition)identifier?

position:id-table-position?

procedure

position)identifier?
position:id-table-position?

procedure

( bound-id-table/c key-ctc
val-ctc
[ #:immutableimmutable])contract?
key-ctc:flat-contract?
immutable:(or/c #t#f'dont-care)='dont-care
Like the procedures for free-identifier tables (make-free-id-table , free-id-table-ref , etc), but for bound-identifier tables, which use bound-identifier=? to compare keys.

Changed in version 6.3.0.3 of package base: Added bound-id-table-keys, bound-id-table-values, in-bound-id-table.
Changed in version 6.3.0.6: Added bound-id-table-ref!, bound-id-table-set*, bound-id-table-set*!, bound-id-table-update!, and bound-id-table-update

2.4Sets with Identifier KeysπŸ”— i

(require syntax/id-set ) package: base

This module provides identifier sets: sets with identifier keys that use identifier-specific comparisons instead of the usual equality operators such as eq? or equal? .

This module implements two kinds of identifier sets: one via free-identifier=? and one via bound-identifier=? . Each are available in both mutable and immutable variants and implement the gen:set , gen:stream , prop:sequence , and gen:equal+hash generic interfaces.

Identifier sets are implemented using identifier tables, in the same way that hash sets are implemented with hash tables.

2.4.1Sets for free-identifier=? πŸ”— i

A free-identifier set is a set whose keys are compared using free-identifier=? . Free-identifier sets implement the gen:set interface, so all of the appropriate generic functions (e.g., set-add , set-map , etc) can be used on free-identifier sets.

procedure

( mutable-free-id-set [ init-set
#:phasephase])mutable-free-id-set?
init-set:generic-set? =null

procedure

( immutable-free-id-set [ init-set
#:phasephase])immutable-free-id-set?
init-set:generic-set? =null
Produces a mutable free-identifier set or immutable free-identifier set, respectively. The set uses free-identifier=? to compare keys.

The identifiers are compared at phase level phase. The default phase, (syntax-local-phase-level ), is generally appropriate for identifier sets used by macros, but code that analyzes fully-expanded programs may need to create separate identifier sets for each phase of the module.

The optional init-set argument provides the initial set elements. It must be a set of identifiers. If the init-set set has multiple distinct entries whose keys are free-identifier=? , only one of the entries appears in the new id-set, and it is not specified which entry is picked.

procedure

( free-id-set? v)boolean?

v:any/c
Returns #t if v was produced by mutable-free-id-set or immutable-free-id-set , #f otherwise.

procedure

( mutable-free-id-set? v)boolean?

v:any/c
Returns #t if v was produced by mutable-free-id-set , #f otherwise.

Returns #t if v was produced by immutable-free-id-set , #f otherwise.

Like set-empty? .

Like set-count .

procedure

( free-id-set=? s1s2)boolean?

Like set=? .

Like set-add .

Like set-add! .

Like set-remove .

Like set-first .

Like set-rest .

Like in-set .

procedure

( free-id-set->stream s)stream?

Like set->list .

Like set-copy .

Like set-clear .

Like set-clear! .

Like set-union .

Like set-union! .

Like subset? .

Like set-map .

procedure

( id-set/c elem-ctc
[ #:setidtypeidsettype
#:mutabilitymutability])contract?
elem-ctc:flat-contract?
idsettype:(or/c 'dont-care'free'bound)='dont-care
mutability : (or/c 'dont-care'mutable'immutable)
= 'immutable
Creates a contract for identifier sets. If mutability is 'immutable, the contract accepts only immutable identifier sets; if mutability is 'mutable, the contract accepts only mutable identifier sets.

procedure

( free-id-set/c elem-ctc
[ #:mutabilitymutability])contract?
elem-ctc:flat-contract?
mutability : (or/c 'dont-care'mutable'immutable)
= 'immutable
Creates a contract for free-identifier sets. If mutability is 'immutable, the contract accepts only immutable identifier sets; if mutability is 'mutable, the contract accepts only mutable identifier sets.

2.4.2Sets for bound-identifier=? πŸ”— i

A bound-identifier set is a set whose keys are compared using bound-identifier=? . Bound-identifier sets implement the gen:set interface, so all of the appropriate generic functions (e.g., set-add , set-map , etc.) can be used on bound-identifier sets.

procedure

( mutable-bound-id-set [ init-set
#:phasephase])mutable-bound-id-set?
init-set:set? =null

procedure

( immutable-bound-id-set [ init-set
#:phasephase])
init-set:set? =null

procedure

( bound-id-set? v)boolean?

v:any/c

procedure

( bound-id-set->stream s)stream?

procedure

( bound-id-set/c elem-ctc
[ #:mutabilitymutability])contract?
elem-ctc:flat-contract?
mutability : (or/c 'dont-care'mutable'immutable)
= 'immutable
Like the procedures for free-identifier sets (e.g., immutable-free-id-set , free-id-set-add , etc.), but for bound-identifier sets, which use bound-identifier=? to compare keys.

2.5Hashing on bound-identifier=? and free-identifier=? πŸ”— i

This library is for backwards-compatibility. Do not use it for new libraries; use syntax/id-table instead.

procedure

id
[ failure-thunk])any
failure-thunk : (-> any )
= (lambda ()(raise (make-exn:fail ....)))

procedure

id
v)void?
v:any/c

procedure

proc)void?
proc:(identifier? any/c . -> .any )

procedure

proc)(listof any?)
proc:(identifier? any/c . -> .any )

procedure

id
[ failure-thunk])any
failure-thunk : (-> any )
= (lambda ()(raise (make-exn:fail ....)))

procedure

proc)void?
proc:(identifier? any/c . -> .any )

procedure

( free-identifier-mapping-map free-mapproc)(listof any?)

proc:(identifier? any/c . -> .any )

procedure

id
[ failure-thunk])any
failure-thunk : (-> any )
= (lambda ()(raise (make-exn:fail ....)))

procedure

id
v)void?
v:any/c

procedure

proc)void?
proc:(identifier? any/c . -> .any )

procedure

proc)(listof any?)
proc:(identifier? any/c . -> .any )
The same as make-free-identifier-mapping , etc.

2.6Rendering Syntax Objects with FormattingπŸ”— i

procedure

( syntax->string stx-list)string?

stx-list:(and/c syntax? stx-list? )
Builds a string with newlines and indenting according to the source locations in stx-list; the outer pair of parens are not rendered from stx-list.

2.7Computing the Free Variables of an ExpressionπŸ”— i

procedure

( free-vars expr-stx
[ insp
#:module-bound?module-bound?])
expr-stx:syntax?
insp:inspector? =mod-decl-insp
module-bound?:any/c =#f
Returns a list of free lambda - and let -bound identifiers in expr-stx in the order in which each identifier first appears within expr-stx. The expression must be fully expanded (see Fully Expanded Programs and expand ).

The inspector insp is used to disarm expr-stx and sub-expressions before extracting identifiers. The default insp is the declaration-time inspector of the syntax/free-vars module.

If module-bound? is non-false, the list of free variables also includes free module-bound identifiers.

Examples:
> (require (for-syntax racket/basesyntax/parsesyntax/free-vars))
> (define-syntax (print-body-free-varsstx)
#:literals(lambda )
[(_ (~and lam(lambda (a... )b... )))
(define expanded-body(local-expand #'lam'expression'()))
(syntax-parse expanded-body
#:literals(#%plain-lambda )
[(#%plain-lambda (arg... )body)
(displayln (free-vars #'body))
expanded-body])]))
> (lambda (x)(print-body-free-vars(lambda (y)x)))

(#<syntax:eval:3:0 x>)

#<procedure>

2.8Replacing Lexical ContextπŸ”— i

procedure

( strip-context form)any/c

form:any/c
Removes all lexical context from syntax objects within form, preserving source-location information and properties.

Typically, form is a syntax object, and then the result is also a syntax object. Otherwise, pairs, vectors, boxes, hash tables, and prefab structures are traversed (and copied for the result) to find syntax objects. Graph structure is not preserved in the result, and cyclic data structures will cause strip-context to never return.

Changed in version 7.7.0.10 of package base: Repaired to traverse hash tables in stx.

procedure

( replace-context ctx-stxform)any/c

ctx-stx:(or/c syntax? #f)
form:any/c
Uses the lexical context of ctx-stx to replace the lexical context of all parts of all syntax objects in form, preserving source-location information and properties of those syntax objects.

Syntax objects are found in form the same as in strip-context .

Changed in version 7.7.0.10 of package base: Repaired to traverse hash tables in stx.

2.9Helpers for Processing Keyword SyntaxπŸ”— i

The syntax/keyword module contains procedures for parsing keyword options in macros.

keyword-table = (dict-ofkeyword(listofcheck-procedure))

A keyword-table is a dictionary (dict? ) mapping keywords to lists of check-procedures. (Note that an association list is a suitable dictionary.) The keyword’s arity is the length of the list of procedures.

Example:
> (define my-keyword-table

check-procedure = (syntaxsyntax->any)

A check procedure consumes the syntax to check and a context syntax object for error reporting and either raises an error to reject the syntax or returns a value as its parsed representation.

Example:
> (define (check-stx-string stxcontext-stx)
(raise-syntax-error #f"expected string"context-stxstx))
stx)

options = (listof(listkeywordsyntax-keywordany...))

Parsed options are represented as an list of option entries. Each entry contains the keyword, the syntax of the keyword (for error reporting), and the list of parsed values returned by the keyword’s list of check procedures. The list contains the parsed options in the order they appeared in the input, and a keyword that occurs multiple times in the input occurs multiple times in the options list.

procedure

table
[ #:contextctx
#:no-duplicates?no-duplicates?
#:incompatibleincompatible
#:on-incompatibleincompatible-handler
#:on-too-shorttoo-short-handler
#:on-not-in-tablenot-in-table-handler])
stx:syntax?
ctx:(or/c #fsyntax? )=#f
no-duplicates?:boolean? =#f
incompatible:(listof (listof keyword? ))='()
= (lambda (....)(error ....))
= (lambda (....)(error ....))
not-in-table-handler :
= (lambda (....)(error ....))
Parses the keyword options in the syntax stx (stx may be an improper syntax list). The keyword options are described in the table association list. Each entry in table should be a list whose first element is a keyword and whose subsequent elements are procedures for checking the arguments following the keyword. The keyword’s arity (number of arguments) is determined by the number of procedures in the entry. Only fixed-arity keywords are supported.

Parsing stops normally when the syntax list does not have a keyword at its head (it may be empty, start with a non-keyword term, or it may be a non-list syntax object). Two values are returned: the parsed options and the rest of the syntax (generally either a syntax object or a list of syntax objects).

A variety of errors and exceptional conditions can occur during the parsing process. The following keyword arguments determine the behavior in those situations.

The #:contextctx argument is used to report all errors in parsing syntax. In addition, ctx is passed as the final argument to all provided handler procedures. Macros using parse-keyword-options should generally pass the syntax object for the whole macro use as ctx.

If no-duplicates? is a non-false value, then duplicate keyword options are not allowed. If a duplicate is seen, the keyword’s associated check procedures are not called and an incompatibility is reported.

The incompatible argument is a list of incompatibility entries, where each entry is a list of at least two keywords. If any keyword in the entry occurs after any other keyword in the entry, an incompatibility is reported.

Note that including a keyword in an incompatibility entry does not prevent it from occurring multiple times. To disallow duplicates of some keywords (as opposed to all keywords), include those keywords in the incompatible list as being incompatible with themselves. That is, include them twice:

;Disallow duplicates of only the #:foo keyword
(parse-keyword-options ....#:incompatible'((#:foo#:foo)))

When an incompatibility occurs, the incompatible-handler is tail-called with the two keywords causing the incompatibility (in the order that they occurred in the syntax list, so the keyword triggering the incompatibility occurs second), the syntax list starting with the occurrence of the second keyword, and the context (ctx). If the incompatibility is due to a duplicate, the two keywords are the same.

When a keyword is not followed by enough arguments according to its arity in table, the too-short-handler is tail-called with the keyword, the options parsed thus far, the syntax list starting with the occurrence of the keyword, and ctx.

When a keyword occurs in the syntax list that is not in table, the not-in-table-handler is tail-called with the keyword, the options parsed thus far, the syntax list starting with the occurrence of the keyword, and ctx.

Handlers typically escape—all of the default handlers raise errors—but if they return, they should return two values: the parsed options and a syntax object; these are returned as the results of parse-keyword-options .

Examples:
#'(#:transparent#:propertyp(lambda (x)(fx)))
(list (list '#:transparent)
(list '#:inspectorcheck-expression )

'((#:transparent #<syntax:eval:4:0 #:transparent>)

(#:property

#<syntax:eval:4:0 #:property>

#<syntax:eval:4:0 p>

#<syntax:eval:4:0 (lambda (x) (f x))>))

'()

#'(#:transparent#:inspector(make-inspector ))
(list (list '#:transparent)
(list '#:inspectorcheck-expression )
#:context#'define-struct
#:incompatible'((#:transparent#:inspector)
(#:inspector#:inspector)
(#:inspector#:inspector)))

define-struct: #:inspector option not allowed after

#:transparent option

procedure

stx
table
[ #:contextctx
#:no-duplicates?no-duplicates?
#:incompatibleincompatible
#:on-incompatibleincompatible-handler
#:on-too-shorttoo-short-handler
#:on-not-in-tablenot-in-table-handler
#:on-not-eolnot-eol-handler])
options
stx:syntax?
ctx:(or/c #fsyntax? )=#f
no-duplicates?:boolean? =#f
incompatible:(listof (list keyword? keyword? ))='()
= (lambda (....)(error ....))
= (lambda (....)(error ....))
not-in-table-handler :
= (lambda (....)(error ....))
not-eol-handler :
= (lambda (....)(error ....))
Like parse-keyword-options , but checks that there are no terms left over after parsing all of the keyword options. If there are, not-eol-handler is tail-called with the options parsed thus far, the leftover syntax, and ctx.

procedure

( options-select optionskeyword)(listof list? )

options:options
keyword:keyword?
Selects the values associated with one keyword from the parsed options. The resulting list has as many items as there were occurrences of the keyword, and each element is a list whose length is the arity of the keyword.

procedure

( options-select-row options
keyword
#:defaultdefault)any
options:options
keyword:keyword?
default:any/c
Like options-select , except that the given keyword must occur either zero or one times in options. If the keyword occurs, the associated list of parsed argument values is returned. Otherwise, the default list is returned.

procedure

keyword
#:defaultdefault)any
options:options
keyword:keyword?
default:any/c
Like options-select , except that the given keyword must occur either zero or one times in options. If the keyword occurs, the associated list of parsed argument values must have exactly one element, and that element is returned. If the keyword does not occur in options, the default value is returned.

procedure

( check-identifier stxctx)identifier?

stx:syntax?
ctx:(or/c #fsyntax? )
A check-procedure that accepts only identifiers.

procedure

( check-expression stxctx)syntax?

stx:syntax?
ctx:(or/c #fsyntax? )
A check-procedure that accepts any non-keyword term. It does not actually check that the term is a valid expression.

procedure

(( check-stx-listof check)stxctx)(listof any/c )

stx:syntax?
ctx:(or/c #fsyntax? )
Lifts a check-procedure to accept syntax lists of whatever the original procedure accepted.

procedure

( check-stx-string stxctx)syntax?

stx:syntax?
ctx:(or/c #fsyntax? )
A check-procedure that accepts syntax strings.

procedure

( check-stx-boolean stxctx)syntax?

stx:syntax?
ctx:(or/c #fsyntax? )
A check-procedure that accepts syntax booleans.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /