mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
[language] convert identifier to string when used as the name in a pair
This commit is contained in:
parent
b47e1940e9
commit
12eb1d8f68
6 changed files with 25 additions and 6 deletions
|
|
@ -415,10 +415,15 @@ The `break` and `continue` functions from the standard library also return retur
|
|||
|
||||
Pairs associate two arbitrary values.
|
||||
|
||||
Pairs are built using the `_:_` identifier, with the left argument giving the name and the right the value of the pair.
|
||||
Pairs are built using the `_:_` identifier, with the left argument giving the name and the right the value of the pair. If the left argument is an identifier, it will be converted to a string for convenience.
|
||||
|
||||
```
|
||||
"name":"value"
|
||||
"name":"value" -- is the same as
|
||||
name:"value"
|
||||
|
||||
-- if you need to use the value associated with the `name` variable instead, the identifier can be wrapped in parentheses
|
||||
:name = "key"
|
||||
(name):"value"
|
||||
```
|
||||
|
||||
### Tuple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue