X-Git-Url: https://ocean-lang.org/code/?p=ocean-D;a=blobdiff_plain;f=Ocean-types;h=16714803a186af0502d3c45205a47aec6e4501ab;hp=c25bd1be7ca16f3a9b418f97e7d938b8917e36f7;hb=4cdd68c1e0a2b774c04bb251ad788ccfd958660e;hpb=5b97b38c643628f0845dbfcf050f0b382b2f7ac3 diff --git a/Ocean-types b/Ocean-types index c25bd1b..1671480 100644 --- a/Ocean-types +++ b/Ocean-types @@ -278,3 +278,29 @@ Questions: a(args) is Call(a, args) - need a new Binode type - Tuple. So I have to delay 'const' assessment to later too. + +---------- +Where do type definition go? +I don't think they go with statements, they belong separately. +I don't want the full separation of a "type" section like Pascal +So they probably go at the top level, equivalent to "program" - and before. +They start with "struct" or "enum" or "record" etc. + +So: what about constants? These are currently statements and so affect a scope in time. +But for declaring arrays in structs, or initial values of fields, we might want constants. +A constant could be within a struct, but only that it too limiting. I need module-wide +constants. +So I guess: + + const: + name ::= value + name ::= value + +or + const { name ::= value ; name ::= value } + +-------------- +I'm in the middle of stage-1 on structures. + +I need a type to parse the declaration into. It needs to be a linked list +of fields, each of which is a type, a name, and an initial value. i.e. a 'struct field'.