You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of BaseAffix has the push method insert an Affix object in a stack (thereby pushing down the Affix objects below it one slot further). This is done by modifying the pushing Affix component's and the inserted one's next_affix references so that
the pushing Affix component's points at the new Affix object to be inserted, and
the inserted one's points to where the pushing Affix pointed at previously,
I think that the push method should also be able to push Affix stacks, i.e. components with already set-up interlinking. Apart from potential race conditions, you could implement similar functionality by parsing the desired Affix stack string manually and pushing multiple times, but why reimplement functionality that already exists? affix_stack has a build_stack method for the first part, and BaseAffix.push can be amended to set the correct references (the current Affix's, and the new stack's bottommost) by adding a bit of stack inspection.
(I'll add a practical example where this is really useful in a bit.)
The text was updated successfully, but these errors were encountered:
The current implementation of BaseAffix has the
push
method insert an Affix object in a stack (thereby pushing down the Affix objects below it one slot further). This is done by modifying the pushing Affix component's and the inserted one'snext_affix
references so thatlike inserting an element in a single-linked list. See https://github.com/SeattleTestbed/affix/blob/master/components/baseaffix.r2py#L175-L180.
I think that the
push
method should also be able to push Affix stacks, i.e. components with already set-up interlinking. Apart from potential race conditions, you could implement similar functionality by parsing the desired Affix stack string manually andpush
ing multiple times, but why reimplement functionality that already exists?affix_stack
has abuild_stack
method for the first part, andBaseAffix.push
can be amended to set the correct references (the current Affix's, and the new stack's bottommost) by adding a bit of stack inspection.(I'll add a practical example where this is really useful in a bit.)
The text was updated successfully, but these errors were encountered: