Re: Phix : nested structs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thank you for your quick and detailed response.

petelomax said...

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.

petelomax said...


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.

petelomax said...


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?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu