> So the reason we have formatters in the first place is so that the app > writer can customize these things. Since there are already 2 names > for this, I'd rather not add a third. Anybody can trivially add > whatever name they want.
True enough. > > There is a similar issue with how the context is mutated in a repeated > > section, which was difficult to understand. It is made worse in the > > PHP implementation (which tries very much to be a close copy), since > > that is marked as an iterator, thus implying an iterator contract. > > There are no notes that if the iteration were to stop for some reason, > > that the context stack would be hosed. > > I don't see how else you would implement this. I actually changed > Python to be more like JS recently. It was also using a Python > iterator, which was confusing. An explicit Next() works well. The > ScopedContext keeps track of the cursor. The cursor is the only > "variable" in JSON Template (and now @index too), but it must be > mutated. Well, the simple thing is to push the iterated context on the stack explicitly and pop it in every interation of the loop. The only real reason not to do it this way is if there is a large performance penalty. > Remember with distributed VCS you have your own local repo. When you > commit you're only changing your own repo -- so you can commit as many > times as you want and break things into logical chunks. Only pushing > changes the authoritative repository. A frequent usage is that you > make every single change a branch. Merging is cheap, unlike with SVN > where it is only for experts. You can switch among the different > branches with hg update: > > http://mercurial.selenic.com/wiki/NamedBranches Sigh. If I were more verse in distributed VCS, I could have made things easier. I'm learning here, and have no intuition for it yet. > And it is also only takes 3 seconds to clone an entirely new repo, so > if you don't want to deal with multiple heads in one repo, you can > have multiple repos. That I can do. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
