Function with variable number of arguments; default *inside* the function?
- To: mathgroup at smc.vnet.net
- Subject: [mg35798] Function with variable number of arguments; default *inside* the function?
- From: AES <siegman at stanford.edu>
- Date: Thu, 1 Aug 2002 04:35:08 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Simple tests I've carried out seem to show that I'm able to generate a simple function that will accept either one or two lists as arguments by coding it in the form func[list1, list2_:defaultList} := Module[{ }, <<stuff>> ] and then calculating the defaultList _inside_ the module. Seems to work OK -- but am I setting myself up for any hidden gotcha's by doing this?