[Python-ideas] Anaphoric if

Scott Dial scott+python-ideas at scottdial.com
Mon Apr 26 14:09:15 CEST 2010


On 4/25/2010 1:17 AM, Raymond Hettinger wrote:
> The term anaphoric reference seems to be from the field of linguistics.
>  Wikipedia gives this explanation:
> """
> An anaphoric reference, when opposed to cataphora, refers to something
> within a text that has been previously identified. For example, in
> /"Susan dropped the plate. It shattered loudly"/ the word /"it"/ refers
> to the phrase /"the plate"/.
> """ 

And one should take the lesson from linguistics that such constructs are
often confusing and ambiguous (e.g., "The dog ate the bird and it
died.") This is related to the problem with "if not foo() as x" and
moreover "if not foo() and bar() as x:". This doesn't appear to be an
obvious win of clarity over "x = not foo() and bar(); if x:" Let's not
inherit the bad grammar of natural languages into programming languages.

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu



More information about the Python-ideas mailing list