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 #75447 is a reply to message #75367] Tue, 08 March 2011 07:56 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
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.

>> 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.
[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: Sat Oct 11 03:42:01 PDT 2025

Total time taken to generate the page: 2.96106 seconds