some strange behavior

2009-08-08 Thread //o
Writing a small opengl text printer (vertex based) I have found that the next lines are "illegal" to dmd (2.031): invariant float[][][] CHARS =[ [//A [0,0], [1/2f,2], [1,0], [3/4f,1], [1/4f,1] ] ]; dmd complains (compiling with dmd -c bug.d): bug.d

some strange behavior

2009-08-08 Thread //o
Writing a small opengl text printer (vertex based) I have found that the next lines are "illegal" to dmd (2.031): invariant float[][][] CHARS =[ [//A [0,0], [1/2f,2], [1,0], [3/4f,1], [1/4f,1] ] ]; dmd complains (compiling with dmd -c bug.d): bug.d

Re: how does range.put work

2009-08-08 Thread Jos van Uden
Daniel Keep wrote: No; read the code. Before the put, a and b are pointing to the same span of memory. a.put(5) puts the value 5 into the front (first element) of the array, then advances the array. However, put can't "see" b, so it doesn't get updated along with a. The end result is that b

Re: how does range.put work

2009-08-08 Thread Daniel Keep
Jos van Uden wrote: > Oliver wrote: >>> The source code for the standard library comes with the compiler. >>> If you look in std\array.d, you find this around line 279 (reflowed for >>> readability): void put(T, E)(ref T[] a, E e) { assert(a.length); a[0] = e; a = a[1 .. $]

Re: how does range.put work

2009-08-08 Thread Jos van Uden
Oliver wrote: The source code for the standard library comes with the compiler. If you look in std\array.d, you find this around line 279 (reflowed for readability): void put(T, E)(ref T[] a, E e) { assert(a.length); a[0] = e; a = a[1 .. $]; } Would anybody care to explain what this is

rdmd on win32 works

2009-08-08 Thread Jos van Uden
Hello everybody, New to D, just playing around with it. Not having a C++ background, I need to learn it little by little. So many things that puzzle me. Anyway, just now I managed to get the rdmd shell script to work on my windows machine. http://www.digitalmars.com/d/2.0/rdmd.html I downloade