Skip to content

Special Attributes #8

Description

@Pacman99

Many times there are attributes you want to include in a POP for utility purposes, but they shouldn't be in the end result(after unpopping). There should be some way to mark certain attributes as special.

This could also replace #1 since you can just add extenders in a pop's extension and mark those attributes as "special", so they get removed when unpopping.

p = pop {
  defaults.value = 0;
  extension = self: super: {
    # Mark increment as "special" somehow
    increment = pop { supers = [ self ]; extension = _: _: { value = super.value + 1; }; };
  };
}
unpop (p.increment.increment) => { value = 2; }

or with #7

pop {
  defaults.value = 0;
  extension = self: super: {
    increment = self (self: super: { value = super.value + 1; });
  };
}

cc @fare

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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