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

Home » Public Forums » archive » N_ELEMENTS and WHERE: Scalar or Array ?
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: N_ELEMENTS and WHERE: Scalar or Array ? [message #14180 is a reply to message #14130] Wed, 03 February 1999 00:00 Go to previous messageGo to previous message
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
Stein Vidar Hagfors Haugan <steinhh@ulrik.uio.no> wrote:
> In article <36b5d66b.0@news.nwl.ac.uk> wmc@bas.ac.uk writes:

>> If this is necessary for legacy reasons, it might be possible to make
>> () and [] behave differently in this case? Possibly a missed
>> opportunity when [] came in!

> How'bout {} ? :-) I'm not *just* kidding. [] work as both array
> constructors and indexing brackets, so {} could work as both
> structure constructors and indexing brackets..

Hmm, having three different sorts of brackets to make arrays is
a bit of overkill. Anyway, {} might be needed for associative
arrays one day!

>>> array[NaN] = 5 ; Would be allowed, but does nothing
>>
>> This could well be possible as an easy-to-do work-around. In that
>> case, where would have to return NaN not -1.

> (Yes - though with a WHERE(..,/nan) switch)

Hmm, that would be acceptable. Or an nwhere function (a bit less typing).

>> Incidentally, I've just realised how dangerous the out-of-bounds stuff
>> is:
>>
>> array([where(array eq false)])='stoat'
>>
>> assigns to the first element...

> And you can *bet* some program(mer)s out there are counting on
> exactly this as a *feature*! Sorry to say so, but...that's why
> you'd have to introduce a keyword switch in WHERE.

Well, they are very silly people then. Does anyone on this newsgroup want
to confess to using this "feature"?

-W.

--
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
[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
Read Message
Read Message
Read Message
Previous Topic: Scalp editting??
Next Topic: Map spanning Dateline?

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

Current Time: Sat Oct 11 14:58:59 PDT 2025

Total time taken to generate the page: 0.80655 seconds