A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.racket-lang.org/reference/stxcmp.html below:

12.3 Syntax Object Bindings

12.3 Syntax Object Bindings🔗ℹ

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

.

Examples:

> (check a a)

'binds

> (check a b)

'no-binds

> (define-syntax-rule (check-a x) (check a x)) > (check-a a)

'no-binds

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

Examples:

> (check car)

'(same: #<procedure:car>)

> (check mcar)

'(different: #<procedure:mcar>)

'(different: #<procedure:list>)

> (require (rename-in racket/base [car kar])) > (check kar)

'(same: #<procedure:car>)

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

.

Returns one of three (if

top-level-symbol?

is

#f

) or four (if

top-level-symbol?

is true) 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

):

If id-stx is bound to a rename-transformer, the result from identifier-binding is for the identifier in the transformer, so that identifier-binding is consistent with free-identifier=?.

If exact-scopes? is a true value, then the result is #f unless the binding for id-stx has exactly the scopes of id-stx. An exact-scopes check is useful for detecting whether an identifier is already bound in a specific definition context, for example.

Changed in version 6.6.0.4 of package base: Added the top-level-symbol? argument to report information on top-level bindings.
Changed in version 8.2.0.3: Generalized phase results to phase–space combinations.
Changed in version 8.6.0.9: Added the exact-scopes? argument.

Changed in version 8.2.0.3 of package base: Generalized phase results to phase–space combinations.

Changed in version 8.2.0.3 of package base: Generalized phase results to phase–space combinations.

Changed in version 8.2.0.3 of package base: Generalized phase results to phase–space combinations.

Like

(identifier-binding id-stx phase-level top-level-symbol?)

, but the result is

#f

if the binding for

id-stx

has scopes that are a subset of the scopes for

wrt-id-stx

. That is, if

id-stx

and

wrt-id-stx

have the same symbolic name, a binding for

id-stx

is returned only if the binding does not also apply to

wrt-id-stx

.

Added in version 8.3.0.8 of package base.
Changed in version 8.8.0.2: Added the top-level-symbol? argument.

Like

identifier-binding

, but produces a symbol that corresponds to the binding. The symbol result is the same for any identifiers that are

free-identifier=?

, but the result may also be the same for identifiers that are not

free-identifier=?

(i.e., different symbols imply different bindings, but the same symbol does not imply the same binding).

When identifier-binding would produce a list, then the second element of that list is the result that identifier-binding-symbol produces.

Added in version 8.3.0.8 of package base.

  stx : stx?   exact-scopes? : any/c = #f

Returns a list of all

interned

symbols for which

(identifier-binding (datum->syntax stx sym) phase-level #f exact-scopes?)

would produce a non-

#f

value. This procedure takes time proportional to the number of scopes on

stx

plus the length of the result list.

Added in version 8.6.0.6 of package base.
Changed in version 8.6.0.9: Added the exact-scopes? argument.

Added in version 8.13.0.8 of package base.

Returns a list that includes all

phase-level

s for which

(syntax-bound-symbols stx phase-level)

might produce a non-empty list.

Examples:

Added in version 8.6.0.8 of package base.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4