[Python-ideas] Ruby-style Blocks in Python Idea

average dreamingforward at gmail.com
Wed Mar 11 01:01:41 CET 2009

FW:  Sorry, forgot to change the subject line for the sake of threaded
mail readers and archives....

---------- Forwarded message ----------
From: "Stephen J. Turnbull" <stephen at xemacs.org>

Terry Reedy writes:
> > Like many other Pythonistas I recognize that that an uninformative stock
> > name of '<lambda>' is defective relative to an informative name that
> > points back to readable code.  What I dislike is the anonymity-cult
> > claim that the defect is a virtue.
> That's unfair.  Python has "anonymous blocks" all over the place,
> since every control structure controls one or more of them.  It simply
> requires that they be forgotten at the next DEDENT.  Surely you don't
> advocate that each of them should get a name!
> I think this is a difference of cognition.  Specifically, people who
> don't want to name blocks as functions may not abstract processes to
> signatures as easily, and reify whole processes (including all free
> identifiers!) as objects more easily, as those who don't think naming
> is a problem.
> > Since I routinely use standard names 'f' and 'g' (from math) to name
> > functions whose name I do not care about, I am baffled (and annoyed) by...
> If the cognition hypothesis is correct, of course you're baffled.  You
> "just don't" think that way, while he really does.  The annoyance can
> probably be relieved by s/a developer/some developers/ here:

I'm glad you're bringing out the cognitive aspect of this, because to
me, though it may seem "gratuitously mystical or mystifying" , there
is an essential epistemological component to this issue related to the
[bidirectional] cognitive mapping of and between mathematical <-- and
--> psychological identity and the confusion stems from the inability
to frame the issue around a single linear "classical" construct as
generally imposed by typed text (did you follow that?).  Even writing
this sentence confounds my multidimensional meaning which I'm trying
to compress into standard language constructs.  Normally, I'd use hand
gestures and inflection to split out the two different orthogonal
aspects of what I'm trying to convey which simply cannot occupy the
same space at the same time, but (obviously) that luxury is
unavailable here.  So in the end, unless there's sufficient purchase
in the listener, I have to be somewhat content sounding like a moron
spouting gibberish.

What Tav's proposal, in my mind, is aiming to do is provide greater
syntactic support within Python so as to minimize cognitive gibberish
when the code is reified in the mind of the viewer.   Of course, it
doesn't help that were culturally trained into VonNeuman
architecture-thinking were such conflation of dimensionality is built
into the hardware itself.  Really, like Stephan is pointing out,
"re-ification" *IS* the best analogy to help elucidate of this issue
(better in German: Verdinglichung).  See wikipedia's "Reification
(Marxism)"  (--though be prepared that, depending on your state of
mind, it will either make sense or sound like its logic is [perfectly]
backward, like some flipped bit because it borders that special
interplay between subject-object.)

These kind of [Anonymous] functions/code blocks explicitly tell the
user that "This is NOT part of my program", yet (due to the classical,
flat nature of standard computer programming) I must "include" (in a
constrained way since I'm not able to include the context or
externalized identity in which this code will be run) it here [in my
editor window text] even though its logical geometry is orthogonal to
my program.  It's like a vortex out of flatland--an interface into a
different dimension, hence it's difficulty in explaining it to the
natives of flatlandia.  To put a name on it puts an identity label
upon something pointing in the wrong direction (i.e. to the
surrounding code) which isn't *meant* to be an an independent block of
usable code or be part of the social context of its surroundings.
It's like seeing your own body's innards mapped inside-out into a
computer program and calling it "marcos" while I continue to function
normally in some other dimensionality in some mysterious way to
magically maintain my normal cognition elsewhere.  Better to see those
innards as anonymous data (that for whatever reason I'm needing to
interface to) even though they are perfectly functioning blocks with
an identity elsewhere (i.e.:  me).  So, yes, "anonymity" can be a
virtue from a given perspective.

...Seems to be a parallel to meta-programming but on the other side of
the scale--instead of abstracting "upwards" into greater levels of
abstraction, it abstracts  sideways and downwards into levels of
concreteness.  Naming in both cases is problematic if you want to
avoid the categorical errors easily made by the flatland of the typed



More information about the Python-ideas mailing list