[Python-ideas] Python-ideas Digest, Vol 28, Issue 19

spir denis.spir at free.fr
Wed Mar 11 12:28:28 CET 2009

Le Tue, 10 Mar 2009 16:50:13 -0700,
average <dreamingforward at gmail.com> s'exprima ainsi:

> 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 [...]

Indeed. In the concatenative jargon such code-data constructs are called "quotations".

	:squares [dup *] map
	... [1 2 3] squares yields [1 4 9]

[dup *] (dup means duplicate) is sensibly called a quotation, I guess, by analogy to meta-linguistic expressions that "objectify" a snippet of speech. [dup *] holds the literal expression of a valid func def, as illustrated by:

	:square dup *

It is pushed on the data stack that should already hold a sequence ([1 2 3]), then both are data items used by map. Read: the higher order func map takes a func def and a sequence as arguments.
Now this is alien (fremd ;-) to anybody used to languages in which code is not, conceptually, *really* data -- even if it has a type and can be denoted, in python, simply by letting down the ().

la vita e estrany

More information about the Python-ideas mailing list