[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I stupid?



Bob Crawford <r_w_crawford@yahoo.com> writes:


>H C Pumphrey wrote:

>> In article <onn16cvpe1.fsf@cow.physics.wisc.edu>, Craig Markwardt <craigmnet@cow.physics.wisc.edu> writes:
>> |> Not that [IDL's policy on keyword uniqueness] doesn't frustrate the heck
>> |> out of me sometimes.  There
>> |> are many times where I want keywords like TIME, TIMEUNIT, TIMESTEP,
>> |> and so on.  My suggestion is that the above policy should hold,
>> |> *unless* there is an exact match to a specific keyword.
>>
>> That seems to be what R [1] does already. Apart from this special case, I don't
>> see any way around it, not without IDL having a direct link to your
>> subconscious so that it can tell which out of TIME, TIMEUNIT and TIMESTEP
>> you meant when you said FOO,TI=137

>... but it should know what you meant when you say: FOO, TIME=37

>Bob.
>(sometimes frustrated too)


It is quite possible to redefine the rules such that one could unambiguously
have the keywords TIME and TIMESTEP simultaneously.  However, consider what
happens when a user mistakenly abbreviates TIMESTEP=3 to TIME=3.  Under the
present rules, IDL signals that a possible error has occured.  But with the
proposed new rules, no error message would be generated--it would just happily
go ahead and do the wrong thing!

I've also been occasionally frustrated by this behavior, but I've come to the
conclusion (a little reluctantly) that it's actually ``A Good Thing''.  In a
perfect world, we could be sure that the user remembered not to use TIME as an
abbreviation of TIMESTEP, but you and I know that we don't live in a perfect
world.

It would be better, as somebody has already suggested, if situations like this
were caught by the compiler, instead of waiting until somebody actually tried
to use the TIME keyword.  But the present abbreviation rules should not be
changed.

William Thompson