1 Language Model
2 Syntactic Forms
3 Datatypes
4 Structures
5 Classes and Objects
6 Units
7 Contracts
8 Pattern Matching
9 Control Flow
10 Concurrency
11 Macros
12 Input and Output
13 Reflection and Security
14 Operating System
15 Memory Management
16 Running PLT Scheme
Bibliography
Index
On this page:
bound-identifier=?
free-identifier=?
free-transformer-identifier=?
free-template-identifier=?
free-label-identifier=?
check-duplicate-identifier
identifier-binding
identifier-transformer-binding
identifier-template-binding
identifier-label-binding
Version: 4.0.2

 

11.3 Syntax Object Bindings

(bound-identifier=? a-id b-id [phase-level])  boolean?

  a-id : syntax?

  b-id : syntax?

  

phase-level

 

:

 

(or/c exact-integer? false/c)

 

 

 

=

 

(syntax-local-phase-level)

Returns #t if the identifier a-id would bind b-id (or vice-versa) if the identifiers were substituted in a suitable expression context at the phase level indicated by phase-level, #f otherwise. A #f value for phase-level corresponds to the label phase level.

(free-identifier=? a-id b-id [phase-level])  boolean?

  a-id : syntax?

  b-id : syntax?

  

phase-level

 

:

 

(or/c exact-integer? false/c)

 

 

 

=

 

(syntax-local-phase-level)

Returns #t if a-id and b-id access the same lexical, module, or top-level binding at the phase level indicated by phase-level. A #f value for phase-level corresponds to the label phase level.

“Same module binding” means that the identifiers refer to the same original definition site, not necessarily the require or provide site. Due to renaming in require and provide, the identifiers may return distinct results with syntax-e.

(free-transformer-identifier=? a-id b-id)  boolean?

  a-id : syntax?

  b-id : syntax?

Same as (free-identifier=? a-id b-id (add1 (syntax-local-phase-level))).

(free-template-identifier=? a-id b-id)  boolean?

  a-id : syntax?

  b-id : syntax?

Same as (free-identifier=? a-id b-id (sub1 (syntax-local-phase-level))).

(free-label-identifier=? a-id b-id)  boolean?

  a-id : syntax?

  b-id : syntax?

Same as (free-identifier=? a-id b-id #f).

(check-duplicate-identifier ids)  (or/c identifier? false/c)

  ids : (listof identifier?)

Compares each identifier in ids with every other identifier in the list with bound-identifier=?. If any comparison returns #t, one of the duplicate identifiers is returned (the first one in ids that is a duplicate), otherwise the result is #f.

(identifier-binding id-stx [phase-level])

 

 

(or/c (one-of 'lexical #f)

      (listof module-path-index?

              symbol?

              module-path-index?

              symbol?

              (one-of/c 0 1)

              (or/c exact-integer? false/c)

              (or/c exact-integer? false/c)))

  id-stx : syntax?

  

phase-level

 

:

 

(or/c exact-integer? false/c)

 

 

 

=

 

(syntax-local-phase-level)

Returns one of three kinds of values, depending on the binding of id-stx at the phase level indicated by phase-level (where a #f value for phase-level corresponds to the label phase level):

(identifier-transformer-binding id-stx)

 

 

(or/c (one-of 'lexical #f)

      (listof module-path-index?

              symbol?

              module-path-index?

              symbol?

              (one-of/c 0 1)

              (or/c exact-integer? false/c)

              (or/c exact-integer? false/c)))

  id-stx : syntax?

Same as (identifier-binding id-stx (add1 (syntax-local-phase-level))).

(identifier-template-binding id-stx)

 

 

(or/c (one-of 'lexical #f)

      (listof module-path-index?

              symbol?

              module-path-index?

              symbol?

              (one-of/c 0 1)

              (or/c exact-integer? false/c)

              (or/c exact-integer? false/c)))

  id-stx : syntax?

Same as (identifier-binding id-stx (sub1 (syntax-local-phase-level))).

(identifier-label-binding id-stx)

 

 

(or/c (one-of 'lexical #f)

      (listof module-path-index?

              symbol?

              module-path-index?

              symbol?

              (one-of/c 0 1)

              (or/c exact-integer? false/c)

              (or/c exact-integer? false/c)))

  id-stx : syntax?

Same as (identifier-binding id-stx #f).