Skip to content

[Suggestion] Corollary to Bookkeeper's Gambit which keeps the top of the stack and removes the rest #411

Open
@starji

Description

@starji

At the moment, it can be difficult to create stack-stable 'functions' that utilize thoth's because there's no simple way to keep some of the top elements of the stack and remove the rest. A way to do it is to use Flock's Reflection + Gambit + Retrograde Purification, then extract the required elements from the front of the resulting list, but this requires a fair number of patterns and can be inconvenient to write.

A new stack manipulation pattern that can just keep some number of the top elements and discards the rest would make these kinds of utility patterns easier to write. e.g. something like Bookkeeper's Gambit, but removes all other elements of the stack not explicitly kept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions