From: Lawrence D'Oliveiro on 11 May 2010 07:13 In message <mailman.2848.1273495992.23598.python-list(a)python.org>, Stefan Behnel wrote: > But the beauty is that Python is multi-paradigm ... The trouble with “multi-paradigm” is that it offends the zealots on all sides. It's like saying that, to effect a compromise among multiple conflicting monotheistic religions, we should create a polytheistic amalgam of them.
From: Stefan Behnel on 11 May 2010 07:32 Lawrence D'Oliveiro, 11.05.2010 13:13: > Stefan Behnel wrote: > >> But the beauty is that Python is multi-paradigm ... > > The trouble with “multi-paradigm” is that it offends the zealots on all > sides. It's like saying that, to effect a compromise among multiple > conflicting monotheistic religions, we should create a polytheistic amalgam > of them. The Romans were pretty successful in doing so, for several hundred years. Let's see if Python will conquer and rule for that long. Stefan
From: Paul Rubin on 11 May 2010 10:36 Lawrence D'Oliveiro <ldo(a)geek-central.gen.new_zealand> writes: > I thought the opposite of “functional” was “procedural”, not “imperative”. > The opposite to the latter is “declarative”. But (nearly) all procedural > languages also have declarative constructs, not just imperative ones > (certainly Python does). Presumably an “imperative” language would not. Offhand I can't tell that imperative and procedural mean something different. Both basically mean that the programmer specifies a series of steps for the computer to carry out. Functional languages are mostly declarative; for example, an expression like x = 3 is called an "equation" rather than an "assignment". It declares "x is equal to 3", rather than directing x to be set to 3. If someplace else in the program you say "x = 4", that is an error, normally caught by the compiler, since x cannot be equal to both 3 and 4.
From: Michele Simionato on 11 May 2010 10:49 On May 10, 8:18 pm, a...(a)pythoncraft.com (Aahz) wrote: > saying that functional features > are "tacked on" understates the case. Consider how frequently people > reach for list comps and gen exps. Function dispatch through dicts is > the standard replacement for a switch statement. Lambda callbacks are > common. Etc, etc, etc Just to play devil's advocate, I will notice that list comps and gen exps are not really functional (a generator has a state that changes at each call of next). A functional language would use streams instead. Function dispatch through dicts is very lame compared to pattern matching. Lambdas are restricted. There is no tail call optimization. Definitively Python functional features are "tacked on" with respect to a language defined to be functional. Having said that, the functional features are still usable and one can use a functional style in Python if she wants to (module a few caveats).
From: Terry Reedy on 11 May 2010 14:13
On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote: > In message<7xvdavd4bq.fsf(a)ruckus.brouhaha.com>, Paul Rubin wrote: > >> Python is a pragmatic language from an imperative tradition ... > > I thought the opposite of âfunctionalâ was âproceduralâ, not âimperativeâ. > The opposite to the latter is âdeclarativeâ. But (nearly) all procedural > languages also have declarative constructs, not just imperative ones > (certainly Python does). Python has only two: 'global' and now 'nonlocal'. There are also two meta-declarations: the coding cookie (which would/will go away in an entirely unicode world) and future imports (which are effectively temporarily gone in 3.x until needed again). Newbies sometimes trip over def and class being imperative (executable) statments rather than declarations. Terry Jan Reedy |