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

Home » Public Forums » archive » wrapper functions
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: wrapper functions [message #50627 is a reply to message #50504] Fri, 06 October 2006 08:58 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
R.G. Stockwell writes:

>> "David Fanning" <davidf@dfanning.com> wrote...
>>
>>> You could, but the chance of someone passing an R
>>> vector without a G and B vector must be within the
>>> floating underflow error of zero. Why waste time
>>> coding for things that aren't going to happen? :-)
>>
>> Well, the answer to that question is:
>> If a user _can_ break it, a user _will_ break it.
>
> Hey wait, there was a smiley face at the end of it.
> Please disregard my previous message.

When I wrote that statement I realized it was totally
out of character for me (I am normally EXTREMELY anal
when it comes to programming). But, honestly, who
passes an R vector without a G and B? Absolutely
no one.

This is probably the reason these parameters are written
as optional *positional* parameters. You would be out
of your mind to write them as keywords: too much work
for the user. You might write a PALETTE keyword that
would allow you to pass a 3-by-n array of color table
vectors. That would be useful, but then the user would
probably have to figure out how to create a 3 by n array
of color table vectors and even I can't remember how to do
this half the time. :-(

For those of you who haven't read the Dimensional Juggling
Tutorial in some time, you do it like this:

palette = [[r],[g], [b]]

On the other hand, a PALETTE keyword would sure make a lot
more sense here if what we are trying to get across is
that sometimes you pass (or get) a color table and
sometimes you don't. But this would require a LOT more
programming and I would have to ask myself in the end
if making the program "better" is really worth it. In this
case, I think the answer is clearly "probably not".

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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
Previous Topic: .compile_opt strictarr is persistent?
Next Topic: Re: call_procedure with a dynamically created arguments list?

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

Current Time: Sat Oct 11 01:53:53 PDT 2025

Total time taken to generate the page: 0.15592 seconds