On Tue, Oct 6, 2009 at 8:58 PM, Andy Chu <[email protected]> wrote:
> On Tue, Oct 6, 2009 at 2:46 PM, Steven Roussey <[email protected]> wrote:
>>
>>> Right, but just like formatters, you can interpret the predicate
>>> string however you want -- in this case it's "counter plural".  So you
>>> can interpreter one part as a string identifying a node.  If you have
>>> the context, you can look up the argument.  I'll try to code this up.
>>
>> So what is the name of the predicate?
>>  - plural
>>  - counter plural
>
> It's completely up to the application.  JSON Template says nothing
> about how it is interpreted.  I just implemented what I've been
> talking about, which should hopefully clear it up:
>
> http://code.google.com/p/json-template/source/detail?r=48e71023b458e0ecfeb019bff6bd43c5eca7edb5

This wasn't quite complete.  Finished here:

http://code.google.com/p/json-template/source/detail?r=bc0efb5d7759eed483ad70ba67ec502e9dfec461

Formatter args parsed by the *user* at compile time are now passed
into the formatter at runtime.  This all needs some nice documentation
above and beyond the comments in the code...

Although, maybe it is a little too complicated now.  Maybe I can just
preserve compatibility by always doing:

formatter(value) for DictRegistry/CallableRegistry

formatter(value, context, args) for anything else

Right now it is a bit complex as you can do:

formatter(value)
formatter(value, context)
formatter(value, args)
formatter(value, context, args)

If this doesn't translate to other languages maybe it can be simplified.

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