Python and Ruby
Ed Keith
e_d_k at yahoo.com
Sun Jan 31 19:27:09 EST 2010
--- On Sun, 1/31/10, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> From: Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au>
> Subject: Re: Python and Ruby
> To: python-list at python.org
> Date: Sunday, January 31, 2010, 5:36 PM
> 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?
>
>
In a 'pure' functional language a function with no arguments is, by definition, a constant. This is because a 'pure' function will always return the same result whenever given the same arguments. so if it has no argument it always returns a constant value.
-EdK
Ed Keith
e_d_k at yahoo.com
Blog: edkeith.blogspot.com
More information about the Python-list
mailing list