[Python-ideas] Where-statement (Proposal for function expressions)

Stephen J. Turnbull stephen at xemacs.org
Sat Jul 18 11:25:04 CEST 2009


Ben Finney writes:
 > "Stephen J. Turnbull" <stephen at xemacs.org> writes:

 > > In other words, we need better programmers' editors which can
 > > temporarily bring the low-level code close to the high-level code, not
 > > more syntax.

 > That assumes that we only look at program code using such editors,
 > and ignores all the time spent looking at the code on paper, on web
 > sites, in messages to each other, etc.

No, actually it is based on a belief that the problem of serializing a
program in a readable way is in general intractible.

 > If the source code is hard enough to read that we need special tools to
 > make it readable,

Source code is *not* plain text.  In all modern languages it is
explicitly tree-structured.  For that reason, having special tools to
help read it (tags, programmers' editors, IDEs) is a long-established
practice.

The point of the where clause is to allow that tree structure to be
expressed in top-down fashion, keeping subordinate nodes "textually
close" to the root.  Problem is, *that only works for very flat
semantics*, in fact only for a root node and one generation of
descendents (and not very many of them, with none very complex, at
that).  In general, it's just not possible to keep nodes of the
"where" tree close to *both* their parents *and* their siblings at
high levels of the tree.  It seems to me that even for people who like
and use a device like the where clause will quickly run into its
limitations.

It is for *that* reason that I suggested that tools, not syntax, are
the way to go here.




More information about the Python-ideas mailing list