Re: Zero argument functions
- To: mathgroup at smc.vnet.net
- Subject: [mg61743] Re: [mg61686] Zero argument functions
- From: Ken Levasseur <klevasseur at mac.com>
- Date: Fri, 28 Oct 2005 03:25:22 -0400 (EDT)
- References: <200510260501.BAA18762@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
The obvious advantage to the myFunc[]:=(whatever) construction is that it is possible to expand the function to include argument or options at a later time. With the myFunc:=(whatever) that would not be possible since myFunc[x_]:=(anotherwhatever) would evaluate to whatever[]:=(anotherwhatever). KL On Oct 26, 2005, at 1:01 AM, kalymereau at yahoo.fr wrote: > Hi > > For a "function" with no argument, what is the difference between: > > myFunc:=(whatever) > > and > > myFunc[]:=(whatever) > > I find the first syntax simpler, but there are many built-in > Mathematica functions that use the second one. > > Thanks > > Ken Levasseur http://homepage.mac.com/klevasseur/ Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
- References:
- Zero argument functions
- From: kalymereau@yahoo.fr
- Zero argument functions