8.15.0.12
17.17 Syntax Object Maps
import: rhombus/syntax_map | package: rhombus-lib |
function | |
| |
map configuration | |
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 | |
| |
map configuration | |
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.