|
|
@ -46,34 +46,40 @@ Moon defines the following types:
|
|
|
|
on 32 bit CPUs, and a 64 bit int on 64 bit CPUs. These are some integers:
|
|
|
|
on 32 bit CPUs, and a 64 bit int on 64 bit CPUs. These are some integers:
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
1
|
|
|
|
1
|
|
|
|
2
|
|
|
|
2
|
|
|
|
-1
|
|
|
|
-1
|
|
|
|
-12348
|
|
|
|
-12348
|
|
|
|
0
|
|
|
|
0
|
|
|
|
+0
|
|
|
|
+0
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- floats: they're all float64. These are some floats:
|
|
|
|
- floats: they're all float64. These are some floats:
|
|
|
|
|
|
|
|
|
|
|
|
1.0
|
|
|
|
```
|
|
|
|
1.2
|
|
|
|
1.0
|
|
|
|
-9.3
|
|
|
|
1.2
|
|
|
|
3.14
|
|
|
|
-9.3
|
|
|
|
1e9
|
|
|
|
3.14
|
|
|
|
|
|
|
|
1e9
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- complex numbers: they're complex128 values in Go. These are some complex numbers:
|
|
|
|
- complex numbers: they're complex128 values in Go. These are some complex numbers:
|
|
|
|
|
|
|
|
|
|
|
|
1+2i
|
|
|
|
```
|
|
|
|
-9+4i
|
|
|
|
1+2i
|
|
|
|
|
|
|
|
-9+4i
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- strings: they're strings. They're not explicitly required to be composed of
|
|
|
|
- strings: they're strings. They're not explicitly required to be composed of
|
|
|
|
UTF-8 runes but I haven't really been testing binary data, so for the moment,
|
|
|
|
UTF-8 runes but I haven't really been testing binary data, so for the moment,
|
|
|
|
all bets are off here. They're quoted, but maybe I'll go back on that.
|
|
|
|
all bets are off here. They're quoted, but maybe I'll go back on that.
|
|
|
|
These are strings:
|
|
|
|
These are strings:
|
|
|
|
|
|
|
|
|
|
|
|
"this one"
|
|
|
|
```
|
|
|
|
'that one'
|
|
|
|
"this one"
|
|
|
|
|
|
|
|
'that one'
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
You can use single or double quotes. Escape quotes with a backslash.
|
|
|
|
You can use single or double quotes. Escape quotes with a backslash.
|
|
|
|
- objects: or maybe you call them hashes, objects, or associative arrays. Moon
|
|
|
|
- objects: or maybe you call them hashes, objects, or associative arrays. Moon
|
|
|
@ -83,23 +89,27 @@ Moon defines the following types:
|
|
|
|
Also there are no commas between the values but I'm not sure I like this yet,
|
|
|
|
Also there are no commas between the values but I'm not sure I like this yet,
|
|
|
|
so it might change. These are some objects:
|
|
|
|
so it might change. These are some objects:
|
|
|
|
|
|
|
|
|
|
|
|
{name: "jordan" age: 28}
|
|
|
|
```
|
|
|
|
{
|
|
|
|
{name: "jordan" age: 28}
|
|
|
|
one: 1
|
|
|
|
{
|
|
|
|
two: "two is also a number"
|
|
|
|
one: 1
|
|
|
|
pi: 3.14
|
|
|
|
two: "two is also a number"
|
|
|
|
}
|
|
|
|
pi: 3.14
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- lists: they're `[]interface{}` values. They're not typed, and they can be
|
|
|
|
- lists: they're `[]interface{}` values. They're not typed, and they can be
|
|
|
|
heterogenous. Values are separated by spaces. I might put commas back in,
|
|
|
|
heterogenous. Values are separated by spaces. I might put commas back in,
|
|
|
|
that's kinda up in the air right now. These are some lists:
|
|
|
|
that's kinda up in the air right now. These are some lists:
|
|
|
|
|
|
|
|
|
|
|
|
[1 2 3]
|
|
|
|
```
|
|
|
|
[
|
|
|
|
[1 2 3]
|
|
|
|
"one"
|
|
|
|
[
|
|
|
|
2
|
|
|
|
"one"
|
|
|
|
3.14
|
|
|
|
2
|
|
|
|
]
|
|
|
|
3.14
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|