> > {.section post}
> > Title: {title}
> > Body: {body}
> > {section @ @.parent.is-moderator?}
>
> Why do you need that? I think it's a lot simpler if you if you leave
> out the "predicate_scope" and just have the predicate have access to
> the whole stack of namespaces, as I described in the bug.
But then everything has to be a predicate function. Which has to be
implemented in both JS and the server side language. If you have
someone (like a designer) working on templates, they are not the same
person writing the JS/PHP/etc. And it's easier to have someone add an
extra node to JSON than to write extra functions to check on that
extra node in the json.
>
> Like I said, I don't think you need that third degree of freedom.
> It's more complex without adding any power, and it's not all that
> readable.
Readable is a good point. I could have this:
{section @ is-moderator?}
get parsed like this:
scope is @
predicate: is-moderator
Is predicate a function?
If not, is it a json node?
If yes, then apply default predicate 'true' to predicate (target)
So parsed, it looks as if it were this:
{section @ is-moderator|true?}
just like this:
{section @}
looks internally like:
{.section @ @|true?}
There is the problem of possible name conflicts though.
-s
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---