comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Optional parameters
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Optional parameters [message #38189 is a reply to message #38182] Tue, 24 February 2004 14:03 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 24 Feb 2004 14:45:09 -0700, Pavel Romashkin wrote:

> And what exactly would be the purpose of such sequence of calls, other
> than actually trying to *define* foo in the first function call? If I
> didn't need foo re-defined, I'd not even mention it on the first line.
> So this *is* the case for 3 copy-paste calls, I guess :-)
> I never tried to use keywords for this sort of creative purposes. If I
> have a large dataset I don't want to re-compute, I keep it in a pointer
> (or object, allrigh, David? :-) and I try to always know when it gets
> passed into a function to avoid redefinition and other mishaps.
> After all, how is this behavior different than simply
>
> foo = 100 ; foo is now defined, too...

It's different because I'm overloading a keyword to do two things: 1)
take as input a value for foo to override any internal value, and 2)
return the value of foo used (default or otherwise). Admittedly, this
is bad form, but it's actually very convenient when you want to bring
some variable out "over the head" of your function calls, but still
need to be able to set the variable via a parameter. This is
typically for interactive usage, not for real production code, but the
problem still exists.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: pointer and structure stuff ...
Next Topic: Re: Something similar to a "Widget_Container" ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:47:52 PDT 2025

Total time taken to generate the page: 1.19759 seconds