carvel-dev / ytt

YAML templating tool that works on YAML structure instead of text
https://carvel.dev/ytt
Apache License 2.0
1.68k stars 136 forks source link

"Port" over Starlark's native `struct` features to `ytt`'s custom implementation #220

Open pivotaljohn opened 4 years ago

pivotaljohn commented 4 years ago

Starlark's struct has some features we should port over to the ytt implementation of this data structure. Doing so avoids any surprises that arise from an enterprising user seeing the Starlark struct in use, somewhere, and attempting to mimic such expressions in their ytt templates/programs.

Starlark’s struct:

also, there are other Starlark features that struct could opt-in on:

cppforlife commented 4 years ago

implements HasBinary — allowing for + to merge two structs

i would be ok without having this. its a bit weird to merge structs.