Python and Ruby
Steve Holden
steve at holdenweb.com
Mon Feb 1 07:57:16 EST 2010
Terry Reedy wrote:
> On 1/31/2010 7:25 PM, Steven D'Aprano wrote:
>> On Sun, 31 Jan 2010 15:40:36 -0800, Chris Rebert wrote:
>>
>>> On Sun, Jan 31, 2010 at 2:36 PM, Steven D'Aprano
>>> <steve at remove-this-cybersource.com.au> wrote:
>>>> On Sun, 31 Jan 2010 04:28:41 -0800, Ed Keith wrote:
>>>>> In most functional languages you just name a function to access it and
>>>>> you do it ALL the time.
>>>>>
>>>>> for example, in if you have a function 'f' which takes two parameters
>>>>> to call the function and get the result you use:
>>>>>
>>>>> f 2 3
>>>>>
>>>>> If you want the function itself you use:
>>>>>
>>>>> f
>>>>
>>>> How do you call a function of no arguments?
>>>
>>> It's not really a function in that case, it's just a named constant.
>>> (Recall that functions don't/can't have side-effects.)
>
> Three of you gave essentially identical answers, but I still do not see
> how given something like
>
> def f(): return 1
>
> I differentiate between 'function object at address xxx' and 'int 1'
> objects.
>
But in a functional environment you don't need to. That's pretty much
the whole point.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
More information about the Python-list
mailing list