Re: Associative array and ranges

2011-02-03 Thread Steven Schveighoffer
On Wed, 02 Feb 2011 05:11:34 -0500, Nrgyzer nrgy...@gmail.com wrote: Hey guys, I have an associative array like this: T[hash_t] myArray; (T means the template type). Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know

Re: Associative array and ranges

2011-02-03 Thread Nrgyzer
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel Nrgyzer: Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there is something like next() for the foreach-statement but when the array contains

Re: Associative array and ranges

2011-02-03 Thread Steven Schveighoffer
On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel Nrgyzer: Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there is

Re: Associative array and ranges

2011-02-03 Thread Nrgyzer
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel Nrgyzer: Is there any chance to cast/convert this array to an indexed array or is it

Re: Associative array and ranges

2011-02-03 Thread Steven Schveighoffer
On Thu, 03 Feb 2011 10:41:16 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel Nrgyzer: Is there any

Re: Associative array and ranges

2011-02-03 Thread Nrgyzer
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel On Thu, 03 Feb 2011 10:41:16 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com wrote: == Auszug aus

Re: Associative array and ranges

2011-02-03 Thread Stanislav Blinov
03.02.2011 19:34, Nrgyzer пишет: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel This only works if you rarely remove elements (removal in an array is an O(n) operation). -Steve I already thought about using an dynamic array like T[] (which contains all elements that should

Re: Associative array and ranges

2011-02-03 Thread Nrgyzer
== Auszug aus Stanislav Blinov (bli...@loniir.ru)'s Artikel 03.02.2011 19:34, Nrgyzer пишет: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel This only works if you rarely remove elements (removal in an array is an O(n) operation). -Steve I already thought about using

Re: Associative array and ranges

2011-02-03 Thread spir
On 02/03/2011 04:29 PM, Steven Schveighoffer wrote: Again, I'm not sure what the point is of starting in the middle of the array. Are you expecting something different from a hashtable? Maybe what he needs is a plain Lisp-like symbol table (in D, an array of (key value) pairs)? Denis --

Re: Associative array and ranges

2011-02-03 Thread spir
On 02/03/2011 04:41 PM, Nrgyzer wrote: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzernrgy...@gmail.com wrote: == Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel Nrgyzer: Is there any chance to cast/convert this array

Re: Associative array and ranges

2011-02-03 Thread Stanislav Blinov
On 02/03/2011 08:01 PM, Nrgyzer wrote: == Auszug aus Stanislav Blinov (bli...@loniir.ru)'s Artikel 03.02.2011 19:34, Nrgyzer пишет: == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel This only works if you rarely remove elements (removal in an array is an O(n) operation).

Re: Associative array and ranges

2011-02-03 Thread Stanislav Blinov
On 02/04/2011 01:19 AM, Stanislav Blinov wrote: On 02/04/2011 12:48 AM, bearophile wrote: Stanislav Blinov: Nrgyzer: Ah, okay... I already tried some things with [0..i] ~ [i + 1..$] but there was always an error and I thought, it must be done more simply. There is no possible simplier way

Associative array and ranges

2011-02-02 Thread Nrgyzer
Hey guys, I have an associative array like this: T[hash_t] myArray; (T means the template type). Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there is something like next() for the foreach-statement but when

Re: Associative array and ranges

2011-02-02 Thread Simen kjaeraas
Nrgyzer nrgy...@gmail.com wrote: Hey guys, I have an associative array like this: T[hash_t] myArray; (T means the template type). Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there is something like next()

Re: Associative array and ranges

2011-02-02 Thread Jonathan M Davis
On Wednesday 02 February 2011 02:11:34 Nrgyzer wrote: Hey guys, I have an associative array like this: T[hash_t] myArray; (T means the template type). Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there

Re: Associative array and ranges

2011-02-02 Thread bearophile
Nrgyzer: Is there any chance to cast/convert this array to an indexed array or is it possible to iterate over specific indices? I know that there is something like next() for the foreach-statement but when the array contains some thousand instances and I only want iterate over (for example)