Re: Functions vs OOP

2011-09-05 Thread William Gill
On 9/5/2011 3:04 PM, Jean-Michel Pichavant wrote: William Gill wrote: Not to split hairs, but syntactically f(x) is a function in many programming paradigms. As I understand it functional programming places specific requirements on functions, i.e.referential transparency. So f(x) may or may no

Re: Functions vs OOP

2011-09-05 Thread Terry Reedy
On 9/5/2011 1:45 PM, William Gill wrote: On 9/4/2011 9:13 AM, rusi wrote: On Sep 3, 9:15 pm, William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were someho

Re: Functions vs OOP

2011-09-05 Thread Jean-Michel Pichavant
William Gill wrote: Not to split hairs, but syntactically f(x) is a function in many programming paradigms. As I understand it functional programming places specific requirements on functions, i.e.referential transparency. So f(x) may or may not be "functional". x.f() is also a function,

Re: Functions vs OOP

2011-09-05 Thread William Gill
On 9/3/2011 12:25 PM, Steven D'Aprano wrote: William Gill wrote: Are they suggesting that any function that takes an object as an argument should always be a method of that object? Yes. I can think of times when a special application, such as a converter, would take an object as an argumen

Re: Functions vs OOP

2011-09-05 Thread William Gill
On 9/4/2011 9:13 AM, rusi wrote: On Sep 3, 9:15 pm, William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were somehow opposing techniques. Staying with (fo

Re: Functions vs OOP

2011-09-04 Thread Chris Angelico
On Mon, Sep 5, 2011 at 9:41 AM, Steven D'Aprano wrote: > http://docs.python.org/dev/howto/functional.html > > What about the entire "Introduction" section, which starts with this > statement? > > "This section explains the basic concept of functional programming" > > If you would like to suggest i

Re: Functions vs OOP

2011-09-04 Thread William Gill
On 9/4/2011 7:41 PM, Steven D'Aprano wrote: William Gill wrote: The source of my error is "Functional Programming HOWTO (/python-3.1.3-docs-html/howto/functional.html)" For those who don't have access to William's local file system, I expect he's looking at this: http://docs.python.org/relea

Re: Functions vs OOP

2011-09-04 Thread Steven D'Aprano
William Gill wrote: > The source of my error is "Functional Programming HOWTO > (/python-3.1.3-docs-html/howto/functional.html)" For those who don't have access to William's local file system, I expect he's looking at this: http://docs.python.org/release/3.1.3/howto/functional.html or the most

Re: Functions vs OOP

2011-09-04 Thread William Gill
On 9/4/2011 2:32 PM, Terry Reedy wrote: On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote: Ian Kelly wrote: Functional programming is about using functions in the *mathematical* sense. A mathematical function maps one value (or tuple of values) to another value. The mapped value never varies; if

Re: Functions vs OOP

2011-09-04 Thread Terry Reedy
On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote: Ian Kelly wrote: Functional programming is about using functions in the *mathematical* sense. A mathematical function maps one value (or tuple of values) to another value. The mapped value never varies; if it did, it would be a different functi

Re: Functions vs OOP

2011-09-04 Thread rusi
On Sep 3, 9:15 pm, William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. Staying with (for the moment) the suggestion th

Re: Functions vs OOP

2011-09-04 Thread Steven D'Aprano
tinn...@isbd.co.uk wrote: > I think there may be another issue here. If someone says "functional > programming" to me then I would generally assume that they *do* mean > "programming using functions". Strictly speaking you are correct, "functional programming" does mean "programming using func

Re: Functions vs OOP

2011-09-04 Thread Adam Jorgensen
Progranming with functions vs Progranming with objects sounds like C vs. C++ more than functional programming vs. OO programming On 4 September 2011 04:18, William Gill wrote: > On 9/3/2011 9:51 PM, Terry Reedy wrote: > >> >> It is possible that our doc was less than crystal clear. We are >> con

Re: Functions vs OOP

2011-09-04 Thread tinnews
Ian Kelly wrote: > On Sat, Sep 3, 2011 at 10:15 AM, William Gill wrote: > > During some recent research, and re-familiarization with Python, I came > > across documentation that suggests that programming using functions, and > > programming using objects were somehow opposing techniques. > > > >

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 9:51 PM, Terry Reedy wrote: It is possible that our doc was less than crystal clear. We are constantly improving it where we can see fixable faults. If you run across whatever it was and it still seems a bit muddy, post something again. Will do. Thanks. -- http://mail.python.org/m

Re: Functions vs OOP

2011-09-03 Thread Terry Reedy
On 9/3/2011 5:34 PM, William Gill wrote: On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Since in Python, everything is an object, that would mean th

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 5:39 PM, Ben Finney wrote: William Gill writes: On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Can you show exactly where in the Pytho

Re: Functions vs OOP

2011-09-03 Thread Ben Finney
William Gill writes: > On 9/3/2011 3:15 PM, Terry Reedy wrote: > >> William Gill wrote: > >> > >>> During some recent research, and re-familiarization with Python, I > >>> came across documentation > > > > Ours, or someone else's? > > Python. Can you show exactly where in the Python documentatio

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Since in Python, everything is an object, that would mean that every function has to be a method, whic

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 2:50 PM, Ian Kelly wrote: I think you may be confusing "functional programming" and "programming using functions". These are not the same thing. I think you may be right, Ian. It didn't make much sense -- http://mail.python.org/mailman/listinfo/python-list

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 12:29 PM, MRAB wrote: I think you mean "complementary". :-) How polite of you to point out my spelling deficiency. I guess shouldn't be watching football while typing (I'm sure the beer didn't help either). I think that it's all about "state". In functional programming, there's

Re: Functions vs OOP

2011-09-03 Thread Terry Reedy
On 9/3/2011 12:25 PM, Steven D'Aprano wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? that suggests that programming using functions, and programming using objects were somehow opposing techniqu

Re: Functions vs OOP

2011-09-03 Thread Ian Kelly
On Sat, Sep 3, 2011 at 10:15 AM, William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. > > It seems to me that they are c

Re: Functions vs OOP

2011-09-03 Thread Steven D'Aprano
William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. > > It seems to me that they are complimentary. It makes sense to

Re: Functions vs OOP

2011-09-03 Thread MRAB
On 03/09/2011 17:15, William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were somehow opposing techniques. It seems to me that they are complimentary. I th

Functions vs OOP

2011-09-03 Thread William Gill
During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were somehow opposing techniques. It seems to me that they are complimentary. It makes sense to create objects and have so