Re: Phix : nested structs
- Posted by andreasWagner 1 week ago
- 141 views
Thank you for your quick and detailed response.
Structs are just a collection of fields, with atom/bool/string/sequence/struct|object defaulting to 0/false/""/{}/NULL.
Hence offset and target will be NULL unless you explicitly create new Vector2 for them. This should also work:
for i=1 to MAX do array[i]=new(Camera2D,{new(Vector2,{i,i*i}),new(Vector2)}) end for
I think such an explanation would be good for the documentation.
I'm not going to try and pretend the Phix implementation of structs is particularly wonderful.
What matters to me is not whether the solution is perfect or beautiful. What matters is that it exists at all.
I should probably say structs/classes most likely wont be in Phix v2.0, if ever released, though v1.x won't suddenly vanish.
What are the arguments against structs and classes, and what should replace them?

