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

Home » Public Forums » archive » Re: Am I stupid?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Am I stupid? [message #25675] Wed, 11 July 2001 09:36 Go to next message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
Paul van Delst wrote:
> Umm, I haven't had my requisite 4 cups of coffee yet this morning so I may be fading in
> and out here, but if you specify a keyword TIME=something, how is the interpreter supposed
> to know if you are specifying TIME,

if you specify TIME=something, then you are specifying TIME, or <see subject>

> TIMEUNIT abrreviated to "TIME",

"Keywords can be abbreviated to their shortest unique length", which would be TIMEU
(considering that TIME would not be unique, ambiguous with both TIME and TIMESTEP).
Therefore there is no way you could be abbreviating TIMEUNIT to "TIME". (Well, you could
of course, but the interpreter should not allow it.)

> or TIMESTEP abbreviated to "TIME"?

"Keywords can be abbreviated to their shortest unique length", which would be TIMES
(considering that TIME would not be unique, ambiguous with both TIME and TIMEUNIT).
So again, abbreviating TIMESTEP to "TIME" would be illegal.

Simple as that. If a routine only accepted TIMESTEP and TIMEUNIT keywords, then "TIME"
would be ambiguous. If the routine also accepts a TIME keyword, then "TIME" should just
be, well, TIME.

Maybe it's just that I have been drinking coffee all day...

Cheers,
Jaco

P.S.: My only point is that the IDL behaviour is not logical and not documented. In
my own codes I am of course using your suggested fix: TIMEVALUE.

----------------
Jaco van Gorkom gorkom@rijnh.nl
FOM-Instituut voor Plasmafysica `Rijnhuizen', The Netherlands
Re: Am I stupid? [message #25676 is a reply to message #25675] Wed, 11 July 2001 09:48 Go to previous messageGo to next message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Paul van Delst wrote:
...
>> On second reading, the documentation ("IDL> ? abbreviating keywords") exactly
>> describes Craig's suggestion. The full keyword TIME cannot be abbreviated to a
>> shorter unique length, whereas TIMESTEP can be abbreviated to the shortest
>> unique lenght TIMES. Nowhere in the documentation can I find the behaviour that
>> the keyword TIME may not be used, simply because... because... well, for no reason
>> at all actually.
>
> Umm, I haven't had my requisite 4 cups of coffee yet this morning so I may be fading in
> and out here, but if you specify a keyword TIME=something, how is the interpreter supposed
> to know if you are specifying TIME, TIMEUNIT abrreviated to "TIME", or TIMESTEP
> abbreviated to "TIME"? My initial fix would be to rename TIME to TIMEVALUE and stick an
> easy to see comment somewhere in the header warning users about abbreviating these
> keywords too much.

It would know that TIME cannot be an abbreviated keyword, because it's
too short to be unique. Therefore, it must be the full keyword.
Re: Am I stupid? [message #25678 is a reply to message #25675] Wed, 11 July 2001 07:47 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Folks,

I just want to enter Paul Van Delst's name into
nomination for the IDL Expert Programmers Association
Programmer of the Year award.

This newsgroup has become far too tame. I, for one,
greatly appreciate Paul's quixotic attempts to
maintain the IDL status quo and shake things up while
doing so. Why change something that provides such
marvelous food for discussion? (Not to mention the
wonderful subject header.)

Paul's dogged realism in the face of people who
want to have their cake and eat it too is inspiring
to all of us. My hat's off to you, Paul. Please
keep up the good fight!

Cheers,

David

P.S. Let's just say I'm glad Paul is doing this and
not me. I'm getting too old for the hassle. :-(

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Am I stupid? [message #25679 is a reply to message #25678] Wed, 11 July 2001 07:21 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Jaco van Gorkom wrote:
>
> Paul van Delst wrote:
>> Jaco van Gorkom wrote:
>>> Craig Markwardt wrote:
>>>> "Liam E. Gumley" <Liam.Gumley@ssec-nospam.wisc.edu> writes:
>>>> > Colin Rosenthal wrote:
>>>> > > ... to have a keyword AXISCOLOR in a routine that also accepts
>>>> > > the AX keyword. ...
>>>> > ...
>>>> > "Keywords can be abbreviated to their shortest unique length"
>>>> >
>>>> > In your case, the keyword AX precludes the use of another keyword which
>>>> > begins with the letters "AX". ...
>>>>
>>>> ... 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.
>
> On second reading, the documentation ("IDL> ? abbreviating keywords") exactly
> describes Craig's suggestion. The full keyword TIME cannot be abbreviated to a
> shorter unique length, whereas TIMESTEP can be abbreviated to the shortest
> unique lenght TIMES. Nowhere in the documentation can I find the behaviour that
> the keyword TIME may not be used, simply because... because... well, for no reason
> at all actually.

Umm, I haven't had my requisite 4 cups of coffee yet this morning so I may be fading in
and out here, but if you specify a keyword TIME=something, how is the interpreter supposed
to know if you are specifying TIME, TIMEUNIT abrreviated to "TIME", or TIMESTEP
abbreviated to "TIME"? My initial fix would be to rename TIME to TIMEVALUE and stick an
easy to see comment somewhere in the header warning users about abbreviating these
keywords too much.

> So I would consider this to be a bug, not a policy.

A bug... hmmm. In the user-written code maybe for using ambiguous keyword definitions that
allows newcomers to IDL (or people that are trying to switch from Matlab :o) to get quite
frustrated as to why the code they just downloaded won't work right.

>> It will make code harder to read and understand. Once you give your code to others, they
>> may use it in other code with abbreviated keywords and not enough comments as to what they
>> are doing.
>
> I fully agree, *if* you are referring to the general (over-)use of keyword abbreviation.

I guess. I personally never abbreviate keywords in code, but I also have found the 31
character limit on variable names in f90/95 to be limiting on occasion. :o)

If you are concerned about writing robust code that can't be broken easily, making any
keyword _roots_ (like "TIME" in Craig's example) unambiguous would, to me at least, seem
like the easiest first step.

>>> So who is frustrated enough to put in a feature
>>> request with RSI (/VNI?) for this, for the benefit of us all?
>> I wonder if there is a way for me to write a little Perl script to automatically send in a
>> Feature Un-Request whenever this Feature Request is emailed to RSI...... :o)
>
> :-) . `Feature request' was the wrong wording. I should have said `bug report'.
> Paul, would you take the honours? :-)

My bug report would reflect Craig's point: How come I can compile .pro files with
ambiguous keyword _roots_ ? (that's my phrase for today... :o)

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: Am I stupid? [message #25680 is a reply to message #25679] Wed, 11 July 2001 07:03 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Craig Markwardt wrote:
>
> Paul van Delst <paul.vandelst@noaa.gov> writes:
>
>> It will make code harder to read and understand. Once you give your
>> code to others, they may use it in other code with abbreviated
>> keywords and not enough comments as to what they are doing. The
>> current set up does not allow this.
>>
>> Therefore it is A Good Thing. :o)
>>
>>> So who is frustrated enough to put in a feature
>>> request with RSI (/VNI?) for this, for the benefit of us all?
>>
>> I wonder if there is a way for me to write a little Perl script to
>> automatically send in a Feature Un-Request whenever this Feature
>> Request is emailed to RSI...... :o)
>
> If that really is the RSI policy, then they should make it an error to
> compile a procedure with ambiguous keywords.

I agree with you absolutely. But isn't that one of the idiosyncracies that c.l.i-p readers
find endearing about IDL? :o)

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: Am I stupid? [message #25683 is a reply to message #25680] Wed, 11 July 2001 04:11 Go to previous messageGo to next message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
Paul van Delst wrote:
> Jaco van Gorkom wrote:
>> Craig Markwardt wrote:
>>> "Liam E. Gumley" <Liam.Gumley@ssec-nospam.wisc.edu> writes:
>>>> Colin Rosenthal wrote:
>>>> > ... to have a keyword AXISCOLOR in a routine that also accepts
>>>> > the AX keyword. ...
>>>> ...
>>>> "Keywords can be abbreviated to their shortest unique length"
>>>>
>>>> In your case, the keyword AX precludes the use of another keyword which
>>>> begins with the letters "AX". ...
>>>
>>> ... 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.

On second reading, the documentation ("IDL> ? abbreviating keywords") exactly
describes Craig's suggestion. The full keyword TIME cannot be abbreviated to a
shorter unique length, whereas TIMESTEP can be abbreviated to the shortest
unique lenght TIMES. Nowhere in the documentation can I find the behaviour that
the keyword TIME may not be used, simply because... because... well, for no reason
at all actually. So I would consider this to be a bug, not a policy.

> It will make code harder to read and understand. Once you give your code to others, they
> may use it in other code with abbreviated keywords and not enough comments as to what they
> are doing.

I fully agree, *if* you are referring to the general (over-)use of keyword abbreviation.

> The current set up does not allow this.

Yes it does. That's what keyword abbreviation is all about.

>> So who is frustrated enough to put in a feature
>> request with RSI (/VNI?) for this, for the benefit of us all?
> I wonder if there is a way for me to write a little Perl script to automatically send in a
> Feature Un-Request whenever this Feature Request is emailed to RSI...... :o)

:-) . `Feature request' was the wrong wording. I should have said `bug report'.
Paul, would you take the honours? :-)

Cheers,
Jaco

----------------
Jaco van Gorkom gorkom@rijnh.nl
FOM-Instituut voor Plasmafysica `Rijnhuizen', The Netherlands
Re: Am I stupid? [message #25684 is a reply to message #25683] Wed, 11 July 2001 02:57 Go to previous messageGo to next message
colinr is currently offline  colinr
Messages: 30
Registered: July 1999
Member
On 10 Jul 2001 14:50:08 GMT,
H C Pumphrey <hcp@newsread.ed.ac.uk> 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 .

What it needs is a syntax to force it to interpret a particular
keyword literally.

--
Colin Rosenthal
Astrophysics Institute
University of Oslo
Re: Am I stupid? [message #25685 is a reply to message #25684] Wed, 11 July 2001 02:56 Go to previous messageGo to next message
colinr is currently offline  colinr
Messages: 30
Registered: July 1999
Member
On Tue, 10 Jul 2001 08:53:30 -0500,
Liam E. Gumley <Liam.Gumley@ssec-nospam.wisc.edu> wrote:
> Colin Rosenthal wrote:
>>
>> pro stupid,a=a,a1=a1
>>
>> print,'a=',a
>> print,'a1=',a1
>>
>> end
>>
>> IDL> stupid,a=1,a1=2
>> % Ambiguous keyword abbreviation: A.
>>
>> so is there a sensible way around this? What I'm actually trying to
>> do is to have a keyword AXISCOLOR in a routine that also accepts
>> the AX keyword. I know I could call it something different but am I
>> just being a whiny luser if I think the above code should work
>> as is?

> According to the IDL documentation:
>
> "Keywords can be abbreviated to their shortest unique length"
>
> In your case, the keyword AX precludes the use of another keyword which
> begins with the letters "AX". A good rule of thumb is to make the first
> 3 characters of each keyword unique.

Thanks Liam, but I didn't invent the "AX" keyword!

--
Colin Rosenthal
Astrophysics Institute
University of Oslo
Re: Am I stupid? [message #25687 is a reply to message #25685] Tue, 10 July 2001 18:21 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Paul van Delst <paul.vandelst@noaa.gov> writes:

> It will make code harder to read and understand. Once you give your
> code to others, they may use it in other code with abbreviated
> keywords and not enough comments as to what they are doing. The
> current set up does not allow this.
>
> Therefore it is A Good Thing. :o)
>
>> So who is frustrated enough to put in a feature
>> request with RSI (/VNI?) for this, for the benefit of us all?
>
> I wonder if there is a way for me to write a little Perl script to
> automatically send in a Feature Un-Request whenever this Feature
> Request is emailed to RSI...... :o)

If that really is the RSI policy, then they should make it an error to
compile a procedure with ambiguous keywords. If I can define the TIME
and TIMEUNIT keywords, then I should fairly well be able to use them
both! [ Now I could be sneaky and use _EXTRA to get around this, but
you've just told us why not to be sneaky. :-]

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Am I stupid? [message #25692 is a reply to message #25687] Tue, 10 July 2001 09:37 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Jaco van Gorkom wrote:
>
> Craig Markwardt wrote:
>> "Liam E. Gumley" <Liam.Gumley@ssec-nospam.wisc.edu> writes:
>>> Colin Rosenthal wrote:
>>>> ... to have a keyword AXISCOLOR in a routine that also accepts
>>>> the AX keyword. ...
>>> ...
>>> "Keywords can be abbreviated to their shortest unique length"
>>>
>>> In your case, the keyword AX precludes the use of another keyword which
>>> begins with the letters "AX". A good rule of thumb is to make the first
>>> 3 characters of each keyword unique.
>> ...
>> Not that this 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.
>
> There is no reason why this behaviour could not be introduced in the next
> version of IDL, or is there?

It will make code harder to read and understand. Once you give your code to others, they
may use it in other code with abbreviated keywords and not enough comments as to what they
are doing. The current set up does not allow this.

Therefore it is A Good Thing. :o)

> So who is frustrated enough to put in a feature
> request with RSI (/VNI?) for this, for the benefit of us all?

I wonder if there is a way for me to write a little Perl script to automatically send in a
Feature Un-Request whenever this Feature Request is emailed to RSI...... :o)

Unambiguously Yours,

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: Am I stupid? [message #25694 is a reply to message #25692] Tue, 10 July 2001 08:23 Go to previous messageGo to next message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
Craig Markwardt wrote:
> "Liam E. Gumley" <Liam.Gumley@ssec-nospam.wisc.edu> writes:
>> Colin Rosenthal wrote:
>>> ... to have a keyword AXISCOLOR in a routine that also accepts
>>> the AX keyword. ...
>> ...
>> "Keywords can be abbreviated to their shortest unique length"
>>
>> In your case, the keyword AX precludes the use of another keyword which
>> begins with the letters "AX". A good rule of thumb is to make the first
>> 3 characters of each keyword unique.
> ...
> Not that this 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.

There is no reason why this behaviour could not be introduced in the next
version of IDL, or is there? So who is frustrated enough to put in a feature
request with RSI (/VNI?) for this, for the benefit of us all?

Jaco

----------------
Jaco van Gorkom gorkom@rijnh.nl
FOM-Instituut voor Plasmafysica "Rijnhuizen", The Netherlands
Re: Am I stupid? [message #25695 is a reply to message #25694] Tue, 10 July 2001 08:03 Go to previous messageGo to next message
Bob Crawford is currently offline  Bob Crawford
Messages: 2
Registered: July 2001
Junior Member
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)
Re: Am I stupid? [message #25697 is a reply to message #25695] Tue, 10 July 2001 07:50 Go to previous messageGo to next message
hcp is currently offline  hcp
Messages: 41
Registered: August 1995
Member
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 .

Hugh

[1] http://www.R-project.org/
--

============================================================ ==============
Hugh C. Pumphrey | Telephone 0131-650-6026
Department of Meteorology | FAX 0131-650-5780
The University of Edinburgh | Replace 0131 with +44-131 if outside U.K.
EDINBURGH EH9 3JZ, Scotland | Email hcp@met.ed.ac.uk
OBDisclaimer: The views expressed herein are mine, not those of UofE.
============================================================ ==============
Re: Am I stupid? [message #25700 is a reply to message #25697] Tue, 10 July 2001 07:18 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Liam E. Gumley" <Liam.Gumley@ssec-nospam.wisc.edu> writes:

> Colin Rosenthal wrote:
>> so is there a sensible way around this? What I'm actually trying to
>> do is to have a keyword AXISCOLOR in a routine that also accepts
>> the AX keyword. I know I could call it something different but am I
>> just being a whiny luser if I think the above code should work
>> as is?
>
> Colin,
>
> According to the IDL documentation:
>
> "Keywords can be abbreviated to their shortest unique length"
>
> In your case, the keyword AX precludes the use of another keyword which
> begins with the letters "AX". A good rule of thumb is to make the first
> 3 characters of each keyword unique.


Not that this 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.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Am I stupid? [message #25701 is a reply to message #25700] Tue, 10 July 2001 06:53 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Colin Rosenthal wrote:
>
> pro stupid,a=a,a1=a1
>
> print,'a=',a
> print,'a1=',a1
>
> end
>
> IDL> stupid,a=1,a1=2
> % Ambiguous keyword abbreviation: A.
>
> so is there a sensible way around this? What I'm actually trying to
> do is to have a keyword AXISCOLOR in a routine that also accepts
> the AX keyword. I know I could call it something different but am I
> just being a whiny luser if I think the above code should work
> as is?

Colin,

According to the IDL documentation:

"Keywords can be abbreviated to their shortest unique length"

In your case, the keyword AX precludes the use of another keyword which
begins with the letters "AX". A good rule of thumb is to make the first
3 characters of each keyword unique.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: Am I stupid? [message #25767 is a reply to message #25695] Wed, 11 July 2001 14:02 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
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
Re: Am I stupid? [message #25771 is a reply to message #25676] Wed, 11 July 2001 11:08 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
James Kuyper wrote:
>
> Paul van Delst wrote:
> ...
>>> On second reading, the documentation ("IDL> ? abbreviating keywords") exactly
>>> describes Craig's suggestion. The full keyword TIME cannot be abbreviated to a
>>> shorter unique length, whereas TIMESTEP can be abbreviated to the shortest
>>> unique lenght TIMES. Nowhere in the documentation can I find the behaviour that
>>> the keyword TIME may not be used, simply because... because... well, for no reason
>>> at all actually.
>>
>> Umm, I haven't had my requisite 4 cups of coffee yet this morning so I may be fading in
>> and out here, but if you specify a keyword TIME=something, how is the interpreter supposed
>> to know if you are specifying TIME, TIMEUNIT abrreviated to "TIME", or TIMESTEP
>> abbreviated to "TIME"? My initial fix would be to rename TIME to TIMEVALUE and stick an
>> easy to see comment somewhere in the header warning users about abbreviating these
>> keywords too much.
>
> It would know that TIME cannot be an abbreviated keyword, because it's
> too short to be unique. Therefore, it must be the full keyword.

If I understand you (and Jaco) correctly, what you're saying is:

The abbreviated keyword is too short to be unique, therefore it is.

For some reason this discussion bring Godel's Incompleteness Theorem to mind. I think this
is a case where statements can be neither proved nor disproved.... :o)

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: Am I stupid? [message #25774 is a reply to message #25675] Wed, 11 July 2001 10:01 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Jaco van Gorkom writes:

> P.S.: My only point is that the IDL behaviour is not logical and not documented. In
> my own codes I am of course using your suggested fix: TIMEVALUE.

Why would we want our software to be different from the
rest of our lives? Wouldn't that be predicable and boring?

Quite seriously, who would become a programmer if everything
you did worked?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help with findfile
Next Topic: read input from a widget

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

Current Time: Wed Oct 08 14:52:34 PDT 2025

Total time taken to generate the page: 0.00562 seconds