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

Home » Public Forums » archive » HASH question
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: HASH question [message #75445 is a reply to message #75367] Tue, 08 March 2011 10:12 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Mar 8, 10:56 am, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Mar 8, 12:05 pm, Paolo <pgri...@gmail.com> wrote:
>
>> well i never thought of "where" as being particularly awkward
>> inefficient, yes if used a lot
>> alternatively the stars could be sorted alphabetically by ID
>> to allow for fast search
>
> Sorted arrays would not be any faster with where(). It would take a
> custom search function to do it.
yes, value_locate

>
>>> the arrays cannot have elements dynamically added or removed,
>
>> you can do concatenatation to add, say, another bunch of 100 stars
>> stars can be removed by setting the ID to the empty string or
>> using array concatenation yet again
>> not extremly efficient but works
>
> Yes, but it is awkward. One big reason for using dynamic containers is
> to avoid all this juggling, allowing one to just do the operation one
> is interested in doing. Like just adding an element. The same goes for
> retrieving or setting an element from a hash: one can just do the
> access, without having to do searches. That way code is not
> complicated to do a conceptually simple task.

Agreed that it is more complicated to do that with structures.


Ciao,
Paolo
[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
Previous Topic: IDL 8.0 image() scaling
Next Topic: Floating illegal operand error when reach end of for loop

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

Current Time: Fri Oct 10 14:22:32 PDT 2025

Total time taken to generate the page: 0.72622 seconds