Re: Parameters for Dummies [message #30979 is a reply to message #30978] |
Fri, 31 May 2002 10:42   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
David Fanning <david@dfanning.com> writes:
> Sean Raffuse (sean@me.wustl.edu) writes:
>
>> is there any time when I should really be using a positional parameter
>> instead of a keyword parameter? The more I do, the less I see why a
>> positional parameter would ever be better. Yet, I'm sure they're there for
>> a reason. Please enlighten me, oh most wise discussion group.
>
> Here is a loose rule of thumb: Positional parameters are
> for *required* parameters. Keyword parameters are for
> everything else.
An interesting diversion which connects to both Sean's and David's
points. There are a few astronomy software analysis tools (IRAF and
FTOOLS to be specific) which name *all* of their parameters. The
required parameters can be given positionally, in which case you don't
need to give the keyword name, but otherwise you can give all the
parameters as named keywords.
This would be nice for IDL, and seems to be the kind of thing that
Sean was thinking of, but it certainly doesn't exist in IDL as it
stands.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|