nineties / amber

A Language for High-Level Programming with Self-Extension
http://nineties.github.com/amber
Other
338 stars 10 forks source link

template engine #298

Open nineties opened 10 years ago

nineties commented 10 years ago

Following kind of template-instantiation is very common.

f(x, y, z) := {
    code := 'Foo{x, y, z}
    code['y -> y, 'z -> z]
}

I propose a macro instantiate to write it as below.

f(x, y, z) := instantiate(Foo{x, y, z}, y, z)