Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

BaseAffix.push should push substacks too! #61

@aaaaalbert

Description

@aaaaalbert

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,

like 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 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions