Comment #3 on issue 34 by tim.schaub: Repeated section should iterate over  
dictionaries and have special variables $name and $value
http://code.google.com/p/json-template/issues/detail?id=34

Currently you can do this:

{.repeated section foo}

I'm suggesting allowing this:

{.repeated foo}

If one argument, it is the section name, if two, it is the repeat variable  
followed
by the section name:

{.repeated [<repeat_var>] <section_name>}

For objects, the repeat variable would be set to the name of each member in  
the
object.  For arrays, the repeat variable would be set to the index of each  
element in
an array.

Where things would break:

If someone is currently using referencing a member named "section" in a  
repeat block
in their template.

Data:

{"list": [{"section": "foo"}]}

Template:

{.repeated section list}
     {section}
{.end}

Currently produces:

     "foo"

With this proposal this would produce:

     0

I can't think of any other things that would break.  Basically, this  
proposal just
assigns meaning to the second term in the {.repeated section} directive.   
Currently,
it's just an extra word, right?



--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON 
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to