]> ocean-lang.org Git - ocean-D/blobdiff - Ocean-types
updates
[ocean-D] / Ocean-types
index c25bd1be7ca16f3a9b418f97e7d938b8917e36f7..4aa4e8976565620b460e5440a0580297d57d1173 100644 (file)
@@ -278,3 +278,23 @@ 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 }