diff options
| -rw-r--r-- | docs/application/index.md | 4 | ||||
| -rw-r--r-- | docs/application/type.md | 9 | ||||
| -rw-r--r-- | docs/index.md | 2 | ||||
| -rw-r--r-- | docs/language/index.md | 12 | ||||
| -rw-r--r-- | docs/type_system/action.md | 9 | ||||
| -rw-r--r-- | docs/type_system/index.md | 12 | ||||
| -rw-r--r-- | docs/type_system/list.md | 6 | ||||
| -rw-r--r-- | docs/type_system/name.md | 2 | ||||
| -rw-r--r-- | docs/type_system/namespace.md | 19 | ||||
| -rw-r--r-- | mkdocs.yml | 1 |
10 files changed, 37 insertions, 39 deletions
diff --git a/docs/application/index.md b/docs/application/index.md index 49fd22d..68bd1a1 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -32,8 +32,8 @@ ### String/REPL -1. ##### Scan -2. ##### Parse +1. ##### Parse +2. ##### Scan 3. ##### Scope 4. ##### Check 5. ##### Eval diff --git a/docs/application/type.md b/docs/application/type.md index 52b28de..77c567d 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -15,23 +15,18 @@ typedef struct { static const kpl_type_ptr kpl_type_ptr_null = { UINT16_MAX, UINT16_MAX }; -typedef enum __attribute__((packed)) { +typedef enum : uint16_t { // ... } kpl_type_template; -typedef enum __attribute__((packed)) { - // .. -} kpl_type_flags; - typedef union { // ... } kpl_type_body; typedef struct { kpl_type_template template; - uint16_t flags; + _Atomic unt16_t ref_count; kpl_type_ptr self, prev, next, parent; - _Atomic int32_t ref_count; kpl_type_body body; } kpl_type; diff --git a/docs/index.md b/docs/index.md index 08e02d1..64071a8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ readFile("filename", callback(data)) // --- langauge equivalent // Do Soemthing Fn[name; callback] $ ( - ( read; open ) `use "io" + `use "io" [open; read] callback `sync read `sync open `sync name ) `async ("filename"; callback) // Continue while readFile is running diff --git a/docs/language/index.md b/docs/language/index.md index a5dce76..5d1b31f 100644 --- a/docs/language/index.md +++ b/docs/language/index.md @@ -112,12 +112,22 @@ A list of statements between `()` separated by `;` or `\n` # Definitions -A list of type definitions between `[]` separated by `;` or `\n` +A list of definitions between `[]` separated by `;` or `\n` ```text Type[arg] ``` +## Destructuring + +```text +v : Tuple(1; 2; 3) +v [a; b; c] +`log a // I64.a $ 1 +`log b // I64.b $ 2 +`log c // I64.c $ 3 +``` + # Actions A list of statements between `{}` separated by `;` or `\n` associated with a conditional diff --git a/docs/type_system/action.md b/docs/type_system/action.md deleted file mode 100644 index 2917b69..0000000 --- a/docs/type_system/action.md +++ /dev/null @@ -1,9 +0,0 @@ -# Action - ---- - -```text -Action_class `alias Enum[.unknown; .loop; .if; .match; .mutation] - -Action[Action_class; SCOPE; Parent; TARGET; ARGS; STATEMENTS ...] -``` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index bf5870a..36d1142 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -22,15 +22,7 @@ Denotes a field in a template that has not resolved A template by name only expands to all inner fields as `Any` -```text -Int -> Int[Any; Any; Any] -``` - -### Is[TYPE; ...] - -Denotes the type is one of the specified types in the list - -### Generic.SYMBOL +## Generic.SYMBOL Generic for alias and unique types, type is replaced with type passed @@ -94,6 +86,4 @@ Denotes that a field that does not resolve to anything * #### [List](./list.md) -* #### [Action](./action.md) - * #### [Namespace](./namespace.md) diff --git a/docs/type_system/list.md b/docs/type_system/list.md index 149d4de..ae93f1f 100644 --- a/docs/type_system/list.md +++ b/docs/type_system/list.md @@ -2,8 +2,8 @@ --- -A "List" of statements - ```text -List[SCOPE; Parent; STATEMENTS ...] +List_class `alias Enum[.statement; .define; .action; .loop; .if; .match; .mutation] + +List[List_class; Parent; SCOPE; TARGET; STATEMENTS ...] ``` diff --git a/docs/type_system/name.md b/docs/type_system/name.md index d506201..343232b 100644 --- a/docs/type_system/name.md +++ b/docs/type_system/name.md @@ -5,5 +5,5 @@ ```text Name_class `alias Enum[.unknown; .data; .alias; .unique] -Name[Name_class; Is[Void; Value; Var]] +Name[Name_class; TYPE] ``` diff --git a/docs/type_system/namespace.md b/docs/type_system/namespace.md index f6b8b1c..e5b0020 100644 --- a/docs/type_system/namespace.md +++ b/docs/type_system/namespace.md @@ -13,20 +13,33 @@ A file with code ### \`export -##### Type must be Fn, Overload, Const or Shared to export +#### Type must be Fn, Overload, Const or Shared to export + +#### Re-exporting ## Imports ### \`import ```text -Namespace `import Value[String] +namespace : `import Value[String] ``` +All imports are relative to the importer + ### \`use ```text -Namespace `use Value[String] +namespace : `use Value[String] +``` + +## Namespace destructuring + +```text +namespace : `use Value[String] +namespace[scope_name.namespace_name] +namespcae[name] // resolves to namespace[name.name] +`use Value[String] [name] ``` ## Main @@ -36,7 +36,6 @@ nav: - Symbol: 'type_system/symbol.md' - Op: 'type_system/op.md' - List: 'type_system/list.md' - - Action: 'type_system/action.md' - Namespace: 'type_system/namespace.md' - Application: - Runtime: 'application/index.md' |
