From b2d12c00931e8075f594d0b5a0dccb67b9a3cd27 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 12 Oct 2022 07:34:39 +0000 Subject: [PATCH] Update 'Type Specifiers' --- Type-Specifiers.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Type-Specifiers.md b/Type-Specifiers.md index e5a3b4f..e04b22b 100644 --- a/Type-Specifiers.md +++ b/Type-Specifiers.md @@ -13,24 +13,12 @@ Int:5 # Dynamic array of integers {Int ..} -# Static array of 5 integers, with default values -Int:5:<398 298 17 40 98> - -# Object that has two integer members: x and y -Obj:( - .ro x:Int - .ro y:Int) - -# Variable length array of objects that have a single integer member called x -{Obj:(.x Int) ..} +# Static array of 5 integers +Int:5 ``` The first item is always the name that the type inherits from. If the first item is wrapped in curly braces, the type specifier describes a pointer to whatever type is inside of it. If, after the type that is inside of it, there is an elipsis token, the type specifier describes an array of dynamic length. If an item is a UInt token, it defines a static for the type. The type becomes an array of static length. This number cannot be zero, and if no number is given, the length is assumed to be one (which just means it is a singlular value). -If an item is a name token with the value `mut`, the data that the type directly holds becomes mutable. This is only understood if the type specifier is being instantiated in-place—it does not have an effect in [type sections](Type-Definitions). - -If an item is delimited by less than and greater than tokens, it is understood as a simple default value for the type. One or more arguments may be listed in this area, depending on what the length of the type is. - -If an item is delimited by parentheses, it may contian definitions for new members, and new default values for inherited members. This construct is only understood when the type specifier inherits from another object type. \ No newline at end of file +If an item is a name token with the value `mut`, the data that the type directly holds becomes mutable. This is only understood if the type specifier is being instantiated in-place—it does not have an effect in [type sections](Type-Definitions). \ No newline at end of file