On Mon, Sep 7, 2009 at 9:09 AM, Tim Schaub<[email protected]> wrote:
>
> Andy Chu wrote:
>> Hey, thanks for the suggestion.  This has crossed my mind, but so far
>> no one else has brought it up.  How about giving the keys and values
>> special names, e.g. treat it as a 2 element object with "name" and
>> "value" fields, like:
>>
>
> It seems like this could be done without adding more reserved words to
> the language.

The thing I suggested won't cause any name conflicts.  Any data
dictionary with keys called "name" and "value" will still be
formattable.

Although I think they should be made more special-looking, possibly
$name and $value, or @name and @value.


> .repeated user_chosen_1 user_chosen_2
>
> Then user_chosen_1 becomes the name of each member (in user_chosen_2)
> and the cursor (@) assumes the value for each member.

I don't really see a reason for this extra flexibility.  It doesn't
read that intuitively either.

> As suggested in ticket 13 [1], one of 'repeated' or 'section' could go
> in '.repeated section'.  My suggestion would be to give some meaning to
> 'section' and to keep 'repeated'.

That's not quite the suggestion -- it just allows {.section } to
format lists.  {.repeated foo} wouldn't be allowed, it's still
{.repeated section foo}.

But I'm still not convinced about the whole thing.  What situation do
you need this in?  I think for now it would be fine to file an issue
and if someone else brings it up, the details can be worked out.  But
in general there should be many use cases for a new language feature.

Andy

--~--~---------~--~----~------------~-------~--~----~
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