The original Rebol concept behind STRUCT! kind of paralleled OBJECT!, in the sense that there was no separation between the archetype and the instance.
From the Rebol2/Command Documentation:
a-struct: make struct! [
in-string [string!] "Input string"
in-int [integer!] "Input integer"
] ["This is input" 42]
So just as how OBJECT! has no abstract "Class" with no data--that it then instantiates with data--every STRUCT! is an instance.
This isn't how the C which this is trying to model works, and I'm not sure it's a great plan for a language like Rebol either.
I'd rather you'd be able to break this apart:
input-struct!: struct [
in-string [string!] "Input string"
in-int [integer!] "Input integer"
]
a-struct: make input-struct! ["This is input" 42]
When broken up in this way, the design gets much clearer.
Plus I think we have a fighting chance now to be able to get type checking for specific structure types.
I think it's close to where the system can reasonably come up with answers for TYPE OF that are more specific.
>> type of input-struct!
== ~{struct!}~ ; anti
>> type of a-struct
== ~{input-struct!}~ ; anti
And going along with that, more specific type checking:
get-input: func [
return: [input-struct!]
][
return make input-struct! ["Imagine this getting typechecked!" 1020]
]
I see a lot of value in that, while I see little to no upside in having everywhere that takes any structure type only be able to say "STRUCT!".
Plus, there'd be two independently queryable entities, which could react to PICK-ing in different ways... one by letting you access the schema (because it has no data), and the other by giving you the data:
>> input-struct!.in-int
== #[field! [integer!] "Input integer"]
>> a-struct.in-int
== "This is input"
I know we've wanted it for objects, but FFI might get it first...
FFI may be a good prototyping environment for doing this just because it's tangential to the main system operation, and it's easier to muck around with it.
Once the theory is worked out and polished, it could be brought to bear on objects.