Next: expander utils records, Previous: expander utils intro, Up: expander utils [Index]
Return #t
if the identifier id is lexically bound; otherwise
return #f
.
(identifier-bound? #'woppa-woppa-woppa) ⇒ #f (let ((ciao 123)) (define-syntax (doit stx) (identifier-bound? #'ciao)) (doit)) ⇒ #t (let ((ciao 123)) (define-syntax (doit stx) (syntax-case stx () ((_ ?id) (identifier-bound? #'?id)))) (doit ciao)) ⇒ #t (let () (define ciao 123) (define-syntax (doit stx) (syntax-case stx () ((_ ?id) (identifier-bound? #'?id)))) (doit ciao)) ⇒ #t (let () (let-syntax ((ciao (identifier-syntax 123))) (define-syntax (doit stx) (syntax-case stx () ((_ ?id) (identifier-bound? #'?id)))) (doit ciao))) ⇒ #t
Return a string representing the name of the identifier id.
Build and return a new identifier, in the same lexical context of ctx, having the string str as name.
Build and return a new identifier, in the same lexical context of the identifier id, whose string name is the concatenation of prefix and id. prefix can be a string, symbol or identifier.
(import (vicare)) (bound-identifier=? (identifier-prefix "this-" #'that) #'this-that) ⇒ #t
Build and return a new identifier, in the same lexical context of the identifier id, whose string name is the concatenation of id and suffix. suffix can be a string, symbol or identifier.
(bound-identifier=? (identifier-suffix #'this "-that") #'this-that) ⇒ #t
Build and return a new identifier, in the same lexical context of the identifier ctx, whose string name is the concatenation of the arguments item. Each item can be a string, symbol or identifier.
(bound-identifier=? (identifier-append #'this "-that" '-those) #'this-that-those) ⇒ #t
Build and return a new identifier, in the same lexical context of the
identifier ctx, whose string name is the result of formatting the
string template with the arguments item. template can
be a string including the same escape sequences of format
from
(vicare)
(see format). Each item can
be a string, symbol or identifier.
(bound-identifier=? (identifier-format #'here "~a-~a-~a" #'this "that" 'those) #'this-that-those) ⇒ #t
Search the list of identifiers ids for duplicate identifiers; at
the first duplicate found, return it; return #f
if no duplications
are found.
The optional argument identifier= must be the predicate function
used to compare identifiers; when not given it defaults to
free-identifier=?
.
Given the list of identifiers ids remove the duplicate identifiers and return a proper list of unique identifiers.
The optional argument identifier= must be the predicate function
used to compare identifiers; when not given it defaults to
free-identifier=?
.
Search the list of identifiers ids for one that matches id
and return the sublist starting with it; return #f
if id is
not present.
The optional argument identifier= must be the predicate function
used to compare identifiers; when not given it defaults to
free-identifier=?
.
Wrapper for with-syntax
which defines the identifiers
?symbol with the same context of ?ctx. ?ctx must be
an expression evaluating to an identifier; it is evaluated only once.
?symbol must be Scheme symbols.
For example:
(syntax-case stx () ((id) (identifier? #'id) (with-implicits ((#'id x y)) #'(list x y))))
is equivalent to:
(syntax-case stx () ((id) (identifier? #'id) (with-syntax ((x (datum->syntax #'id 'x)) (y (datum->syntax #'id 'y))) #'(list x y))))
NOTE This macro is derived from the one documented in the Chez Scheme User’s Guide.
Next: expander utils records, Previous: expander utils intro, Up: expander utils [Index]