MattCodr wrote:
I have a doubt about the best way to insert and move (not
replace) some data on an array.
I have the vision, that a mapping from a dense range of integers to
some value type and wast (i.e. Theta( n)) changes of this mapping are a
severe hint for a maldesign.
-manfred
On 11 February 2012 10:45, Jonathan M Davis jmdavisp...@gmx.com wrote:
On Friday, February 10, 2012 13:32:56 Marco Leise wrote:
I know that feeling. I had no exposure to functional programming and
options like chain never come to my head. Although map is a concept that
I made friends with
On 02/13/2012 03:19 PM, James Miller wrote:
On 11 February 2012 10:45, Jonathan M Davisjmdavisp...@gmx.com wrote:
On Friday, February 10, 2012 13:32:56 Marco Leise wrote:
I know that feeling. I had no exposure to functional programming and
options like chain never come to my head. Although
On 14 February 2012 06:25, Timon Gehr timon.g...@gmx.ch wrote:
On 02/13/2012 03:19 PM, James Miller wrote:
On 11 February 2012 10:45, Jonathan M Davisjmdavisp...@gmx.com wrote:
On Friday, February 10, 2012 13:32:56 Marco Leise wrote:
I know that feeling. I had no exposure to functional
On 02/13/2012 03:34 PM, James Miller wrote:
Saying it is not quicksort as much as it may conceptually resemble
quicksort is kinda odd, its like saying it is not a car, as much as
it may conceptually resemble a car because it doesn't run on petrol
or gas, but instead runs on environment
On 14 February 2012 12:45, Ali Çehreli acehr...@yahoo.com wrote:
On 02/13/2012 03:34 PM, James Miller wrote:
Saying it is not quicksort as much as it may conceptually resemble
quicksort is kinda odd, its like saying it is not a car, as much as
it may conceptually resemble a car because it
On Tuesday, February 14, 2012 13:02:43 James Miller wrote:
On 14 February 2012 12:45, Ali Çehreli acehr...@yahoo.com wrote:
On 02/13/2012 03:34 PM, James Miller wrote:
Saying it is not quicksort as much as it may conceptually resemble
quicksort is kinda odd, its like saying it is not a car,
On 02/14/2012 12:34 AM, James Miller wrote:
On 14 February 2012 06:25, Timon Gehrtimon.g...@gmx.ch wrote:
On 02/13/2012 03:19 PM, James Miller wrote:
On 11 February 2012 10:45, Jonathan M Davisjmdavisp...@gmx.comwrote:
On Friday, February 10, 2012 13:32:56 Marco Leise wrote:
I know
Am 09.02.2012, 22:03 Uhr, schrieb MattCodr matheus_...@hotmail.com:
On Thursday, 9 February 2012 at 19:49:43 UTC, Timon Gehr wrote:
Note that this code does the same, but is more efficient if you don't
actually need the array:
Yes I know, In fact I need re-think the way I code with this new
On Friday, February 10, 2012 13:32:56 Marco Leise wrote:
I know that feeling. I had no exposure to functional programming and
options like chain never come to my head. Although map is a concept that
I made friends with early.
It would benefit your programming in general to learn a functional
I __believe__ that insertInPlace doesn't shift the elements, but use an
appender allocating another array instead.
Maybe this function do what you want.
int[] arr = [0,1,2,3,4,5,6,7,8,9];
void maybe(T)(T[] arr, size_t pos, T value) {
size_t i;
for (i = arr.length - 1; i
On Thursday, 9 February 2012 at 12:51:09 UTC, Pedro Lacerda wrote:
I __believe__ that insertInPlace doesn't shift the elements,
Yes, It appears that it really doesn't shift the array,
insertInPlace just returns a new array with a new element in n
position.
Maybe this function do what you
On 02/09/2012 03:47 AM, MattCodr wrote:
I have a doubt about the best way to insert and move (not replace) some
data on an array.
For example,
In some cases if I want to do action above, I do a loop moving the data
until the point that I want and finally I insert the new data there.
In D I
On Thu, Feb 09, 2012 at 10:30:22AM -0800, Ali Çehreli wrote:
[...]
But if you don't actually want to modify the data, you can merely
access the elements in-place by std.range.chain:
import std.stdio;
import std.range;
void main()
{
int[] arr = [0,1,2,3,4,5,6,7,8,9];
immutable
On Thursday, 9 February 2012 at 18:30:22 UTC, Ali Çehreli wrote:
On 02/09/2012 03:47 AM, MattCodr wrote:
I have a doubt about the best way to insert and move (not
replace) some
data on an array.
For example,
In some cases if I want to do action above, I do a loop moving
the data
until the
On 02/09/2012 11:03 AM, H. S. Teoh wrote:
On Thu, Feb 09, 2012 at 10:30:22AM -0800, Ali Çehreli wrote:
[...]
But if you don't actually want to modify the data, you can merely
access the elements in-place by std.range.chain:
import std.stdio;
import std.range;
void main()
{
int[]
On Thursday, 9 February 2012 at 19:49:43 UTC, Timon Gehr wrote:
Note that this code does the same, but is more efficient if you
don't actually need the array:
Yes I know, In fact I need re-think the way I code with this new
features of D, like ranges for example.
Thanks,
Matheus.
17 matches
Mail list logo