Indexing into lists/maps.
First test with literal list completed. When it's assigned to a var if fails
This commit is contained in:
parent
61b9d86aa2
commit
ec8fe5a795
1 changed files with 6 additions and 2 deletions
|
|
@ -163,14 +163,18 @@ let c = b + "world"
|
||||||
```
|
```
|
||||||
|
|
||||||
**dates and time**
|
**dates and time**
|
||||||
Create a date with
|
Create a date literal with
|
||||||
```
|
```
|
||||||
let d:date = ""
|
let d:date = d"1979-12-16 16:12:19.000 +01:00"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
more date functions will have to follow.
|
||||||
|
|
||||||
**lists**
|
**lists**
|
||||||
```
|
```
|
||||||
let list = ["foo", "bar", 1, 1.0]
|
let list = ["foo", "bar", 1, 1.0]
|
||||||
|
print(list[1])
|
||||||
|
=> "bar"
|
||||||
```
|
```
|
||||||
No generic types (yet). A list can hold any type.
|
No generic types (yet). A list can hold any type.
|
||||||
* lists support appending with +
|
* lists support appending with +
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue