]> ocean-lang.org Git - ocean-D/blobdiff - Ocean-types
updates
[ocean-D] / Ocean-types
index c25bd1be7ca16f3a9b418f97e7d938b8917e36f7..16714803a186af0502d3c45205a47aec6e4501ab 100644 (file)
@@ -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'.