[Zope-dev] Re: TALES idea: tuple unpacking

Jim Penny jpenny@universal-fasteners.com
Tue, 29 Jul 2003 15:34:47 -0400


On Tue, 29 Jul 2003 14:27:34 -0400
Paul Winkler <pw_lists@slinkp.com> wrote:

> On Tue, Jul 29, 2003 at 06:22:38PM +0100, Chris Withers wrote:
> > Paul Winkler wrote:
> > 
> > >On Wed, Jul 23, 2003 at 11:07:20AM -0500, Evan Simpson wrote:
> > >
> > >>...  This would allow 
> > >>"options/a_mapping/key:items/index:0" rather than 
> > >>"python:options['a_mapping']['items'][0]".
> > >
> > >Why is that an improvement? 
> > 
> > Personally, I find it much easier to read...
> 
> I find the opposite:

Neither is easy to read.  Go to your nearest non-programmer unit,
spousal, parental, whatever.  Watch the My Eyes Glaze Over, (MEGO)
phenomenon take immediate effect.

> 
> Assuming that the reader does NOT understand any python, 
> it doesn't make much sense. The immediate questions arise: "What's a 
> key?" "What's an index?" "What's the difference between them?" 
> "How do I know when to use one or the other?"
> And, how do you answer those questions without talking about
> python data structures?

I agree with Paul here.  I hated the int: because it had nothing to do
with indexing.  I could reluctantly accept index: -- but it will not
help the intended audience.  Only programmers understand things like
indices, keys, etc.  What is worse, is that it builds a bunch on
un-pythonic syntax, which will get in the way of learning python later.

Let ZPT handle the simplest things, and escape to python as needed.

Lo, ZPT has not even a proper expression syntax.  All that is going on
here is creating a syntax for some extremely limited special cases, a
really non-standard syntax.  And, the syntax depends on having some
python programmer create the dictionaries or sequences that are being
referenced.

That to me, is the fatal flaw.  It is hard to argue, on one hand, that a
python programmer is available to you whenever you need a sequence
created, and on the other hand, that he is no longer there to
consult/hand work off to when a simple expression is needed.

Jim Penny