X-Git-Url: https://ocean-lang.org/code/?p=ocean-D;a=blobdiff_plain;f=Ocean-types;h=a89544cc3c87da1b04b679ff0cff88bc5d401720;hp=ed57f26d1407bee3baa002089d14bec3b85688fb;hb=eceb0a08424f3129775dfccc6de1a5f7f5b98d0a;hpb=7805ff3546f5656ecf55787f58c83f030f953b67 diff --git a/Ocean-types b/Ocean-types index ed57f26..a89544c 100644 --- a/Ocean-types +++ b/Ocean-types @@ -146,7 +146,7 @@ What do I do with add subtract multiply divide index ---------- - I currently have an enum of types that is used to test compatability + I currently have an enum of types that is used to test comparability and for propagation. This needs to change .... I guess I need a struct type* What goes in it? - name @@ -167,6 +167,26 @@ What do I do with .Bool.true = a:char; b:char .Bool.false = ...... + I like "inheritance" but that doesn't allow the size of the whole to + be known in advance. + I need a way to talk about which instance is active, even if the value + isn't stored. So Pascal-like variant records are good. + Maybe a struct could be declared as 'extensible' and other structs + could 'extend', and it literally makes it bigger + struct a extensible {x1:int} + struct b extends a {y1:int} + struct c extends a extensible {y2:int} + struct d extends c {z1:int} + + now 'a' has room for x1, (y2 and z1) or y1 + Which is used depends on context .. or by assertion on content. + So extensions can set values for existing fields + struct z extends a {x1=4; string c} + + Syntax is a bit clumsy. Do I need "extensible"?? + + + Are enums just a fancy way of doing 'const'? I could have const: a=1; b=2; c; d