-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is assignment within templates discouraged? #201
Comments
I have similar issue here with Text::Xslate (via Perl and Mojolicious). I can do this:
but I can not do this :
I can do this:
But I can not do this:
or even this:
All is forbidden! After hearing so much about Text::Xslate I thought I give it a try. And after converting all my templates to this system, BAM! it hits me Forbidden, Forbidden, Forbidden. Can anyone shed any light on this? I am in the middle of a project and just found out my car has triangular wheels. |
Assignment within templates is forbidden in Kolon and discouraged by the docs for TTerse. Why is that? The only explanation I have found is a comment that it was for the sake of simplicity.
Context: I am looking for a sandboxed DSL in which people can implement business logic. The target users of the DSL are not Perl programmers, so
Safe
is not an option, and neither are many of the other template engines (e.g.,Text::MicroTemplate
, referenced in the linked comment). TTerse looks like it might do the job very nicely! However, I would like to understand whether assignment is at risk of disappearing in a future release before committing to TTerse.Thank you in advance for your insights!
The text was updated successfully, but these errors were encountered: