chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] More thoughts on Ersatz


From: Moritz Heidkamp
Subject: Re: [Chicken-users] More thoughts on Ersatz
Date: Tue, 12 Mar 2013 19:04:54 +0100

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 <address@hidden> 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 objects, and there needs to be
> a comma *between* the objects in JSON. So I was doing this:

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 to be valid JSON values
(if I understand the way Jinja works correctly here). I'd suggest using
a proper JSON emitter like the one contained in medea
(http://wiki.call-cc.org/eggref/4/medea) instead.

Mortiz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]