El 8 sept 2019, a las 17:59, ducasse <stepharo@netcourrier.com> escribió:
On 8 Sep 2019, at 09:17, ducasse <stepharo@netcourrier.com> wrote:
Hi
Iâm fixing the class definition parser and I have a question.
Iâm stabilizing the API of CDSlotNode
1 âfirst' => LazyClassVariable default: 5. 2 âsecond' => InstanceVariableSlot. 3 âinstVar3â
Here is a proposal
slotdefinition(3) name ? variable name >>> âinstVar3'
slotDefinition(2) slotClass? >>> InstanceVariableSlot
Right now I return a symbol instead of the class but I could return a class. Now I would like to avoid to blindly think that we have a single namespace. So returning a class implies to be sure that the definition is parsed in the same environment than the class it refers and to me this is a constraint I do not like. So I will return a symbol. Let me know what you think.
maybe #slotClassName instead of #slotClass? Iâm not against the symbol...
slotDefinition(1) initializationMessage >>> 'default: 5â or better >>> Node(default: 5) if it exist
Now I do not know what to do: because I can create a message with an empty receiver. Because
Two simple solutions that come to my mind 1) âinstVar3â generates a CDSlotNode with a default #slotClassName = #InstanceVariableSlot (I like this solution the less because it hardcodes in the parser knowledge about the runtime) 2) we have two different nodes (becase they have different syntax) CDSlotNode and CDDefaultSlotNode and DefaultSlotNode does not have a class name and should be visited differently.
S.