Skip to content

Conversation

@Pacman99
Copy link
Member

@Pacman99 Pacman99 commented Jun 16, 2022

This makes pops work similarly to jsonnet objects. Extending a pop is much easier. You just call the pop with the attribute set to extend it with.

The __functor I added has some magic, where it can detect if you just pass it an attrset, a function with one argument, or two arguments and pass arguments appropriately. I think this makes the process of updating pops more elegant. Without it though, I think we could just force the argument passed to the functor be an Extension.

p = pop { defaults.a = 0; }
p { a = 1; }
p (self: { a = 1; b = self.b; })
p (self: super: { a = super.a + 1; b = self.a; })

@Pacman99 Pacman99 requested a review from fare June 16, 2022 16:15
@Pacman99 Pacman99 mentioned this pull request Jun 16, 2022
@Pacman99 Pacman99 marked this pull request as draft June 21, 2022 17:20
@Pacman99 Pacman99 closed this Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants