From: Keats <ke...@ea...> - 2003-06-20 22:07:13
|
I've finally gotten back to work on the #templet an #eval directives. I thought I'd give an update and solicit some feedback. I decided to separate the context from the "templet", so you have to supply the context with the #eval (or use the current context). This means that the templet directive is now equivalent to "#setblock as macro". Since a templet is just a macro, you can expand it using the current context by just specifying the variable name. E.g., ## templet def #templet $t { Some junk with variables like $x and $y } ## expand templet with current context $t So I think I can simplify the #eval directive to just 2 optional parameters, "copy context" and "with <map>". So, the preferred usage would be something like: ## create a new context with the supplied map of variables #eval $t using { "x" : "foo", "y" : 999 } But you could also do: ## use copies of $x and $y from the current context #eval $t copy context or ## use a copy of $y from the current context and override $x #eval $t copy context using { "x" : "foo" } Any thoughts? Keats |