Python and Ruby

Chris Rebert clp2 at rebertia.com
Mon Feb 1 00:40:36 CET 2010


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.)

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list