On this page:
equal_  name
equal_  name
equal_  binding
equal_  name_  and_  scopes
8.15.0.12

17.17 Syntax Object Maps🔗ℹ

 import: rhombus/syntax_map package: rhombus-lib

function

fun equal_name(stx1 :: Name, stx2 :: Name) :: Boolean

 

map configuration

equal_name

Reports whether stx1 and stx2 are the same names symbolically—that is, whether Syntax.unwrap_all returns the same result—independent of whether bindings are the same.

Syntax.equal_names can also be used as a key_comp for Map.by and similar forms.

> equal_name('apple', 'apple')

#true

> equal_name('fruit.apple', 'apple')

#false

> equal_name('fruit.apple', 'fruit.apple')

#true

> def snacks = Map.by(equal_name){ 'apple': 1 }

> snacks['apple']

1

map configuration

equal_binding

 

map configuration

equal_name_and_scopes

Provided as meta.

Equality and hashing configuration for use with Map.by and similar, where keys are compared using syntax_meta.equal_binding and syntax_meta.equal_name_and_scopes, respectively.