From 3ac54394de136f961fd9d014109d1a7097ca1d80 Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 20 Jul 2024 13:04:29 -0400 Subject: [PATCH] Update SPECIFICATION.MD --- SPECIFICATION.MD | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/SPECIFICATION.MD b/SPECIFICATION.MD index 0811426..cbe98a0 100644 --- a/SPECIFICATION.MD +++ b/SPECIFICATION.MD @@ -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 +### 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 ### list @@ -280,7 +292,7 @@ error is a form which describes an error that occurred, it is similar to the Go syntax ``` -(item1 item2 …) +«form»[] «atom_token» = [item1 item2 …]; ``` ### set @@ -290,7 +302,7 @@ same as list except does not allow duplicates, allows set operations n is the starting size of the set ``` -«form»{} «atom_token»; +«form»{} «atom_token»(); ``` 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 ``` -«form» ~> «form» «atom_token»; +«form» ~> «form» «atom_token»(); ``` ### tunnel