mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-10-05 15:57:08 +03:00
Add notes on square brackets syntax
This commit is contained in:
parent
d6ea0010c3
commit
8127865012
@ -374,6 +374,7 @@ type Map:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Notice that the getter and setter syntax induces an order on things using the map, since every get or set operation depends on the value of the previous map.
|
Notice that the getter and setter syntax induces an order on things using the map, since every get or set operation depends on the value of the previous map.
|
||||||
|
> **_NOTE:_** Do not get mistaken with lists creation syntax, that also uses `[` `]`.
|
||||||
|
|
||||||
### Mixing syntaxes
|
### Mixing syntaxes
|
||||||
|
|
||||||
|
1
GUIDE.md
1
GUIDE.md
@ -234,6 +234,7 @@ def main:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Will return `1`, which is the first element.
|
Will return `1`, which is the first element.
|
||||||
|
> **_NOTE:_** Despite creating lists with `[` `]`, the syntax used for accessing values as in `type[key]` is actually related to the `Map` built-in type.
|
||||||
|
|
||||||
We also have a syntax sugar for strings in Bend, which is just a list of `u24`
|
We also have a syntax sugar for strings in Bend, which is just a list of `u24`
|
||||||
characters (UTF-16 encoded). The `"Hello, world!"` type we've seen used it!
|
characters (UTF-16 encoded). The `"Hello, world!"` type we've seen used it!
|
||||||
|
Loading…
Reference in New Issue
Block a user