Next: Declarations in Structs, Previous: Optional Fields, Up: Structs [Contents][Index]
It is possible to cast a struct of some particular type into another struct type. Examples:
(poke) deftype Foo = struct { int i; int j; }; (poke) deftype Bar = struct { int k; int j; }; (poke) Bar {j=2} as Foo {} Foo {i=0,j=2}
The semantics of the cast are exactly the same than constructing a struct of the target type using the struct provided as an expression to the cast.