Update SPECIFICATION.MD
This commit is contained in:
parent
518070d2bd
commit
3ac54394de
|
@ -273,6 +273,18 @@ additionally, a None will be evaluated as "false" and Just as "true" in a boolea
|
||||||
|
|
||||||
error is a form which describes an error that occurred, it is similar to the Go programming language and is returned as a monad like the maybe monad above and is unwrapped in a similar way, take a look at the tunnel section for an example
|
error is a form which describes an error that occurred, it is similar to the Go programming language and is returned as a monad like the maybe monad above and is unwrapped in a similar way, take a look at the tunnel section for an example
|
||||||
|
|
||||||
|
### panic
|
||||||
|
|
||||||
|
calling panic on a variable that has an error will halt execution of the node that is running.
|
||||||
|
|
||||||
|
```
|
||||||
|
i32 n = <>; ! this can also be written `i32 b = none;`
|
||||||
|
i32 e ?= n; ! this will be an error
|
||||||
|
if (e.err) { ! since the 'none' error is zero this will only branch if an error exists on the variable
|
||||||
|
panic(e);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## datastructures
|
## datastructures
|
||||||
|
|
||||||
### list
|
### list
|
||||||
|
@ -280,7 +292,7 @@ error is a form which describes an error that occurred, it is similar to the Go
|
||||||
syntax
|
syntax
|
||||||
|
|
||||||
```
|
```
|
||||||
(item1 item2 …)
|
«form»[] «atom_token» = [item1 item2 …];
|
||||||
```
|
```
|
||||||
|
|
||||||
### set
|
### set
|
||||||
|
@ -290,7 +302,7 @@ same as list except does not allow duplicates, allows set operations
|
||||||
n is the starting size of the set
|
n is the starting size of the set
|
||||||
|
|
||||||
```
|
```
|
||||||
«form»{} «atom_token»;
|
«form»{} «atom_token»();
|
||||||
```
|
```
|
||||||
|
|
||||||
sets also have the following transforms associated with them
|
sets also have the following transforms associated with them
|
||||||
|
@ -300,7 +312,7 @@ sets also have the following transforms associated with them
|
||||||
a simple form to form storage
|
a simple form to form storage
|
||||||
|
|
||||||
```
|
```
|
||||||
«form» ~> «form» «atom_token»;
|
«form» ~> «form» «atom_token»();
|
||||||
```
|
```
|
||||||
|
|
||||||
### tunnel
|
### tunnel
|
||||||
|
|
Loading…
Reference in New Issue