Notifications
Clear all

[Closed] Nested structs – continued

Following the previous (now closed) nested structs thread, concluding with

I thought I would chime in with my 2 cents, i.e. that you can also use semicolon instead of parentheses:

struct parentDef
 (
 	childDef = struct childDef (x,y);,
 
 	childInstance = childDef 5 3
 )
  
 parentInstance = parentDef()
  
 parentInstance.childDef --> returns a struct definition

Not forgetting to use the semicolon is about the same mental strain as not forgetting the commas, so it might be worth considering – especially with one-line struct definitions like this one.

1 Reply

Thanks for this. I’m implementing some persistent plugins and custom attributes and it’s pretty messy writing them in this fashion. This should help!