sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
51 stars 2 forks source link

Splat Operators #257

Open robcxyz opened 8 months ago

robcxyz commented 8 months ago

Splat Operators

Allow splat operators to instantiate hooks - ie a_hook **a_dict or a_hook *a_list

Overview

Could be done with the peg parser proposal

Would be really helpful to support splat syntax like this.


obj<-:

  foo: bar

data:

  foo: baz

call_with_tpl->: obj **{{data}}

call_no_tpl->: obj **data

call_raw->: obj **{'foo':'bar}

With splat, you don't need templating as it is always going to be a reference to a var.

This is most helpful when the data is in another file. For my use case, I want to have a number of files that all have the same schema. In that case, I want to be able to quickly validate if the data is right and not have to run full business logic to see if it is right.

Implementation