Re: What is put() useful for with regards to dynamic arrays?

2011-05-02 Thread Lars T. Kyllingstad
On Sat, 30 Apr 2011 00:09:09 -0400, Andrej Mitrovic wrote: import std.range; void main() { int[] a = [1, 2, 3]; a.put(6); assert(a == [2, 3]); a.put([1, 2]); assert(a.length == 0); } Seems kind of odd.. put is implemented as an append method for some

Re: Matrix creation quiz

2011-05-02 Thread bearophile
I was away. Don: That would not fix this problem. You're doing arithmetic on unsigned values, where overflow doesn't happen. My enhancement request about integral overflows asks for two compiler switches: one that turns signed integral overflows (at compile time or run time) into errors,

Re: not an lvalue

2011-05-02 Thread Steven Schveighoffer
On Sun, 01 May 2011 09:30:34 -0400, CrypticMetaphor crypticmetapho...@gmail.com wrote: Hi, I've been away from D for a while, but now I'm back and I'm stuck with an compile time error. I've got a Matrix33 class and a Vector3 class, but something is wrong with the way I return my Vector3

Re: What is put() useful for with regards to dynamic arrays?

2011-05-02 Thread Andrej Mitrovic
Thanks, that post explained it. Obviously I wasn't the first and likely won't be the last person to run into this. Maybe put's documentation could make a note of this.

Re: expression templates

2011-05-02 Thread Don
Mr enuhtac wrote: Hello everyone, I'm new to D and this list (although I've had a look onto D a few years ago). I hope you guys can help me with my questions. At the moment I'm trying to implement some expression template stuff. My first goal is to encode an expression into a type

Difference between stack-allocated class and struct

2011-05-02 Thread Mariusz Gliwiński
What are the differences between class instantiated by scope and struct itself? Two, that comes to my mind are: - vtable existance (yep, struct with inheritation - that's what i like) - lol, i just forgot while writing this e-mail :) Sincerely, Mariusz Gliwiński

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Jonathan M Davis
What are the differences between class instantiated by scope and struct itself? Two, that comes to my mind are: - vtable existance (yep, struct with inheritation - that's what i like) - lol, i just forgot while writing this e-mail First off, I would point out that scoped classes are going

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Mariusz Gliwiński
Firstly, thanks for comprehensive answer and I'd like to excuse for my stupid mistakes, which are caused by learning a lot and not actually programming. On date 2011-05-02 23:03, Jonathan M Davis wrote: Classes are reference types and are meant to be on the heap. Yeah, value vs reference

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Jonathan M Davis
Firstly, thanks for comprehensive answer and I'd like to excuse for my stupid mistakes, which are caused by learning a lot and not actually programming. On date 2011-05-02 23:03, Jonathan M Davis wrote: Classes are reference types and are meant to be on the heap. Yeah, value vs

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Piotr Szturmaj
Mariusz Gliwiński wrote: I'll clarify myself: All i would need is extending - without polymorphism. Containment, can be solution for fields which doesn't annoys so much (although image in auto-generated documentation, just like it's with subclassing, would be nice). Unfortunately, the worse case