diff options
Diffstat (limited to 'docs/type_system')
| -rw-r--r-- | docs/type_system/bit.md | 4 | ||||
| -rw-r--r-- | docs/type_system/buffer.md | 2 | ||||
| -rw-r--r-- | docs/type_system/empty.md | 2 | ||||
| -rw-r--r-- | docs/type_system/function.md | 23 | ||||
| -rw-r--r-- | docs/type_system/list.md | 4 | ||||
| -rw-r--r-- | docs/type_system/union.md | 20 |
6 files changed, 26 insertions, 29 deletions
diff --git a/docs/type_system/bit.md b/docs/type_system/bit.md index ba11f30..e30a536 100644 --- a/docs/type_system/bit.md +++ b/docs/type_system/bit.md @@ -7,7 +7,7 @@ A sequence of bits that can fit into a general register ```text SIZE_FLAGS : BIT_ANY | BIT8 | BIT16 | BIT32 | BIT64 -REPRESENTATION_FLAGS : NUMERIC | INT | INT_UNSIGNED | INT_SIGNED | FLOAT | +REPRESENTATION_FLAGS : INT | INT_UNSIGNED | INT_SIGNED | FLOAT | UTF8 | UTF16 | UTF32 | BOOL @@ -27,8 +27,6 @@ typedef struct { # Alias ```text -Number `alias Bit[[BIT_ANT | NUMERIC]] - Int `alias Bit[[BIT_ANY | INT]] Int_unsiged `alias Bit[[BIT_ANY | INT_UNSIGNED]] diff --git a/docs/type_system/buffer.md b/docs/type_system/buffer.md index dca8ab9..f351b4f 100644 --- a/docs/type_system/buffer.md +++ b/docs/type_system/buffer.md @@ -38,6 +38,8 @@ Array[Generic.T] `alias Buffer[[TYPE] Generic.T] ## ``pop` +## ``reverse` + ## ``join` ## ``split` diff --git a/docs/type_system/empty.md b/docs/type_system/empty.md index 2fae1e7..5903c19 100644 --- a/docs/type_system/empty.md +++ b/docs/type_system/empty.md @@ -8,7 +8,7 @@ Container type can be null %empty ``` -## Use with `Option` Union +## Use with `Result` Union ```text make_array : ([yes] diff --git a/docs/type_system/function.md b/docs/type_system/function.md index af17b74..ed1cf9d 100644 --- a/docs/type_system/function.md +++ b/docs/type_system/function.md @@ -3,15 +3,16 @@ --- ```text -INVOCATION : UNKNOWN | SYNC | ASYNC -STATELESS : INCOMPLETE | NATIVE | NATIVE_INLINE | PROCESS | GENERATOR | REGEX_GENERATOR +MODE: INCOMPLETE | COMPLETE -STATEFUL : TASK | ITERATOR | CLOSURE | BOUND | REGEX +INVOCATION : SYNC | ASYNC + +STATELESS : NATIVE | NATIVE_INLINE | PROCESS | GENERATOR | REGEX_GENERATOR -FLAGS : INVOCATION | STATELESS | STATEFUL +STATEFUL : TASK | ITERATOR | CLOSURE | BOUND | REGEX -Function[[FLAGS]; Body; RETURN_TYPE; Collection[VAR_LIST; TYPE.SYMBOL]] +Function[[MODE | INVOCATION | STATELESS | STATEFUL]; INVOCATION_LIST; Body; RETURN_TYPE; Collection[VAR_LIST; TYPE.SYMBOL]] ``` ## Type Body Object Definitions @@ -25,7 +26,7 @@ typedef struct { # Alias ```text -Fn[Generic.T; Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Function[[FLAGS]; STATE; List; Generic.T; Collection[VAR_TREE_LIST; TYPE.SYMBOL]] +Fn[Generic.T; Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Function[...] ``` # Inline Definition @@ -37,13 +38,13 @@ Fn[Generic.T; Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Function[[FLAGS]; S # Function Classes -## Unknown +## Incomplete -Placeholder before evaluation +A function with an incomplete type, type checking occurs at invocation its complete types are stored in its `INVOCATION_LIST` -## Incomplete +## Complete -A function with an incomplete type, type checking occurs at invocation +A function with a complete type, its sync/async invocations are stored in the `INVOCATION_LIST` ## Native @@ -95,7 +96,7 @@ Invoked regular expression matcher ## \`yield -Yielding wraps the value in the transient union `Next` +Yielding wraps the value in the transient union `Iteration` Return `Void` to stop iteration diff --git a/docs/type_system/list.md b/docs/type_system/list.md index cbd7f84..b3c6dd7 100644 --- a/docs/type_system/list.md +++ b/docs/type_system/list.md @@ -3,13 +3,13 @@ --- ```text -List[[ROOT | STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] PARENT; TARGET; VAR_TREE; Collection[LIST; TYPE]] +List[[ROOT | STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] PARENT; TARGET; ARG; LOOP; VAR_TREE; Collection[LIST; TYPE]] ``` ## Type Body Object Definitions ```c typedef struct { - kpl_ptr parent, target, var_tree, statement_list; + kpl_ptr parent, target, defined, named, var_tree, statement_list; } kpl_type_body_list; ``` diff --git a/docs/type_system/union.md b/docs/type_system/union.md index 2572591..f4b0b04 100644 --- a/docs/type_system/union.md +++ b/docs/type_system/union.md @@ -3,7 +3,7 @@ --- ```text -Union[CONTAINER | TRANSIENT | TRANSIENT_GENERIC] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] +Union[TAG | TRANSIENT] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] ``` ## Type Body Object Definitions @@ -17,7 +17,9 @@ typedef struct { # Alias ```text -Tag[Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Union[[CONTAINER] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] +Tag[Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Union[[TAG] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] + +Transient[Collection[VAR_TREE_LIST; TYPE.SYMBOL]] `alias Union[[TRANSIENT] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] ``` ## Tag Example @@ -37,22 +39,16 @@ u : Tag[I64.a; I64.b; I64.c] $ (.c : 5) # Transient Unions +Return multiple types from a function + Can only be retuned from functions and operations. The inner value must be moved out ## Alias ```text -Transient_generic[Generic.T] `alias Union[[TRANSIENT_GENERIC] Generic.T.value] - -Result[Generic.T] `alias Union[[TRANSIENT] Generic.T.value; Error.error] - -Option[Generic.T] `alias Union[[TRANSIENT] Generic.T.value; Void.null] - -Next[Generic.T] `alias Union[[TRANSIENT] Generic.T.value; Void.done] - -Next_result[Generic.T] `alias Union[[TRANSIENT] Generic.T.value; Error.error; Void.done] +Result[Generic.T] `alias Transient[Generic.T.value; Void.null; Error.error] -Next_option[Generic.T] `alias Union[[TRANSIENT] Generic.T.value; Void.null; Void.done] +Iteration[Generic.T] `alias Transient[Generic.T.value; Void.null; Void.done; Error.error] ``` ## Default Operation |
