Re: [Chicken-users] More thoughts on Ersatz

2013-03-25 Thread Ivan Raikov
Hi Matt, Operator precedence in the ersatz parser was not correct, so I have now fixed it. Expressions consisting of several operators, e.g. {{ if not a > b}} should work without having to be parenthesized. I have also added procedures sexpr->tvalue and tvalue->sexpr for easy conversion betwee

Re: [Chicken-users] More thoughts on Ersatz

2013-03-13 Thread Matt Gushee
Hi, Ivan+group-- On Wed, Mar 13, 2013 at 6:39 PM, Ivan Raikov wrote: > > 1) {% endblock %}: the current grammar does not accept > identifiers after endblock. Is this something required by Jinja? > It's not required, but it's allowed. And, as should be obvious, it doesn't really do anything, ju

Re: [Chicken-users] More thoughts on Ersatz

2013-03-13 Thread John Cowan
Ivan Raikov scripsit: > 7) Name: 'tori' is a bit too generic, I think. Presumably German is the > native language of Chicken, so I chose what I think expresses the nature of > templates, yet is somewhat self-deprecating, as ersatz usually means 'poor > substitute' in English and my native Bulgaria

Re: [Chicken-users] More thoughts on Ersatz

2013-03-13 Thread Ivan Raikov
Hi Matt, Thanks for the detailed usage and bug reports and sharing your thoughts with us. Let me try to briefly respond: 1) {% endblock %}: the current grammar does not accept identifiers after endblock. Is this something required by Jinja? 2) super() function: unfortunately, the extend

Re: [Chicken-users] More thoughts on Ersatz

2013-03-13 Thread Peter Bex
On Wed, Mar 13, 2013 at 05:13:10PM -0600, Matt Gushee wrote: > On Tue, Mar 12, 2013 at 1:11 PM, Peter Bex wrote: > > Not to sound like a broken record, but I'd add that this applies 100% to > > HTML/XML as well. I would suggest using SXML or something similar over > > a string-based templating la

Re: [Chicken-users] More thoughts on Ersatz

2013-03-13 Thread Matt Gushee
On Tue, Mar 12, 2013 at 12:04 PM, Moritz Heidkamp < mor...@twoticketsplease.de> wrote: > Matt Gushee writes: > > 3) {% if not loop.last %} also raises a parser error. This was a fairly > > important feature for me, because I have a couple of templates that > > generate JSON from arbitrary-length

Re: [Chicken-users] More thoughts on Ersatz

2013-03-12 Thread Peter Bex
On Tue, Mar 12, 2013 at 08:15:14PM +, Ivan Shmakov wrote: > > Not to sound like a broken record, but I'd add that this applies 100% > > to HTML/XML as well. I would suggest using SXML or something similar > > over a string-based templating language. This allows you to prevent > > injectio

Re: [Chicken-users] More thoughts on Ersatz

2013-03-12 Thread Ivan Shmakov
> Peter Bex writes: > On Tue, Mar 12, 2013 at 07:04:54PM +0100, Moritz Heidkamp wrote: […] >> This doesn't seem like a very good idea to me. You might generate >> invalid JSON if the values you pass into the template don't happen >> to have textual representations which also happen t

Re: [Chicken-users] More thoughts on Ersatz

2013-03-12 Thread Peter Bex
On Tue, Mar 12, 2013 at 07:04:54PM +0100, Moritz Heidkamp wrote: > Hi Matt, > > Matt Gushee writes: > > 3) {% if not loop.last %} also raises a parser error. This was a fairly > > important feature for me, because I have a couple of templates that > > generate JSON from arbitrary-length lists of

Re: [Chicken-users] More thoughts on Ersatz

2013-03-12 Thread Moritz Heidkamp
Hi Matt, thanks a lot for the detailed writeup of your experiences, that was a very interesting read! Being pretty much oblivious with regards to Jinja I will only comment on one issue: Matt Gushee writes: > 3) {% if not loop.last %} also raises a parser error. This was a fairly > important feat

[Chicken-users] More thoughts on Ersatz

2013-03-12 Thread Matt Gushee
Hello, Ivan and anyone else who is interested-- Having just finished successfully converting a web site from Python (Flask framework) to Chicken Scheme, I'd like to summarize my observations on the Ersatz template library. And let me say, Ivan, that although I have a few criticisms, I very much ap