Closures in leu of pointers?

rusi rustompmody at gmail.com
Sun Jun 30 07:42:53 EDT 2013


On Sunday, June 30, 2013 4:52:24 PM UTC+5:30, Steven D'Aprano wrote:
> On Sun, 30 Jun 2013 01:56:25 -0700, rusi wrote:
> > Now having such passes is one thing. Defining the language in terms of
> > them quite another...
> 
> 
> I don't believe that Python's behaviour is defined in terms of the number 
> of passes. It is defined in terms of a condition "if you assign to a 

Yeah sure, I dont believe that python is nearly as bad as C where for example one commonly has to run the preprocessor standalone to debug f---ed up macros.

I was responding to Terry's

> This is not part of the grammar, but implied (required) by the semantic 
> description.

Now in the case of C one would not be able to give a non-operational semantics even with a battalion of denotational semantics PhDs. Python is clearly not so bad, though in some cases the praxis of a certain aspect may be better dealt with operationally than the language spec even if that is non-operational.

A clear case of this is that of mutable default parameters.  Understanding that the def statement is an imperative statement in python and the consequences of that understanding, solves that issue.  However the cost implicit in this is that the semantics has been operationalized.



More information about the Python-list mailing list