Re: Creating Structs using MyStruct(x, y, x) vs creating an object using 'new MyObject'


 

Hi Yves,

Glad that you enjoyed reading chapter 4. Proper multiple-dispatch is a feature that we knew we wanted from the very beginning.

The defstruct expansion is indeed done using Stanza's macro system. If you are curious, the gen-defstruct function in compiler/stz-core-macros.stanza contains the implementation for how defstruct is expanded. The implementation is a bit complex, but it's ultimately just a bunch of s-exp manipulation.

Patrick

Join lbstanza@groups.io to automatically receive all group messages.