Skip to content

[suggestion] a way to call the super function from overridden functions #1

@MayCXC

Description

@MayCXC

i implemented a similar idea to this here https://github.com/MayCXC/envy/blob/master/envy.sh#L45
it pretty much declares a counter and new function, f_0 f_1 f_2... every time a function is given another definition. then f calls the most recent definition, and f_ calls the previous definition. i had to make some pretty extravagant use of eval to get it to work in posix sh, but i think you could do something cleaner for bash with local and perhaps arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions