On Monday, November 19, 2012 07:21:10 Rob T wrote:
> I think you've cleared things up for me.
>
> When I define an opAssign, I'm not really overriding a default
> opAssign, because there is none, instead I'm overriding the
> default behavior which is to perform a memcopy-like operation.
>
> So if
I think you've cleared things up for me.
When I define an opAssign, I'm not really overriding a default
opAssign, because there is none, instead I'm overriding the
default behavior which is to perform a memcopy-like operation.
So if I defined an opAssign function, but for some odd reason I
w
On Monday, November 19, 2012 06:01:55 Rob T wrote:
> I assume that when I define an opAssign, only the opAssign that I
> define gets called, which means there's no blit or postblit being
> called ever again.
>
> I may be thoroughly confused at this point. Is there both a blit
> and a postblit, and
I assume that when I define an opAssign, only the opAssign that I
define gets called, which means there's no blit or postblit being
called ever again.
I may be thoroughly confused at this point. Is there both a blit
and a postblit, and an optional opAssign that when specified will
override bo
Tyro[17]:
Why not simply allow new double[N][3][M]; ?
Seems a lot more intuitive/succinct than a separate []()
implementation.
I think with that there is some ambiguity regarding what
coordinates are fixed-sized arrays and what dynamic arrays.
Bye,
bearophile
On Sunday, November 18, 2012 21:06:58 Tyro[17] wrote:
> On 11/18/12 8:14 PM, bearophile wrote:
> >> Why is no one complaining about this array allocation syntax?
> >
> > A syntax I like is:
> >
> > new double[][3][](N, M)
>
> Why not simply allow new double[N][3][M]; ?
> Seems a lot more intuiti
On 11/18/12 8:14 PM, bearophile wrote:
Why is no one complaining about this array allocation syntax?
A syntax I like is:
new double[][3][](N, M)
Why not simply allow new double[N][3][M]; ?
Seems a lot more intuitive/succinct than a separate []() implementation.
Where:
- The numbers inside
On 11/18/12 7:53 PM, bearophile wrote:
Tyro[17]:
What is the proper way to declare a multidimensional array?
In Java, I can do:
double[][] a = new double[M][N];
In D (hopefully I have not swapped the to sizes, it's a too much common
mistake in my D code):
auto a = new double[][](M, N);
Why is no one complaining about this array allocation syntax?
A syntax I like is:
new double[][3][](N, M)
Where:
- The numbers inside the [] must be always compile-time
constants, and they always refer to fixed-sized arrays.
- The numbers inside the () are run-time values and must be used
fo
auto b = new double[][3][](M, N);
That doesn't compile, I don't know why. The D array syntax
allocation syntax is a bit of a mess. So to do that you have to
write:
auto b = new double[][3][](N);
Or:
auto b = new double[][3][N];
And then fill the arrays with a loop. Why is no one complaining
auto a = new double[][](M, N);
That's a way to declare and initialize a dynamic array of dynamic
arrays. If you want to allocate something else, you need a
different syntax.
Example, this creates something rather different:
auto b = new double[][3][](M, N);
In D there are both dynamic arra
Tyro[17]:
What is the proper way to declare a multidimensional array?
In Java, I can do:
double[][] a = new double[M][N];
In D (hopefully I have not swapped the to sizes, it's a too much
common mistake in my D code):
auto a = new double[][](M, N);
Bye,
bearophile
What is the proper way to declare a multidimensional array?
In Java, I can do:
double[][] a = new double[M][N];
D does not allow this because of two reasons.
1) M & N are variables and cannot be read at compile time even if they
are explicitly initialized.
Error: variable N c
On 2012-05-18 17:11, Maxim Fomin wrote:
Changing template parameter to Bar.f or bar.f affects value of
bar.f.data. Seems to be a bug.
It's a bug. Further reduction:
import std.stdio;
mixin template Foo() {
string data = "default";
}
struct Bar {
mixin Foo f;
}
string get_data(alias u
On Sunday, 18 November 2012 at 16:01:10 UTC, Tobias Pankrath
wrote:
On 18.11.2012 16:46, Namespace wrote:
Ok, understood.
I hoped that I could create a better interface.
I think a good interface would be a generic array class/struct
that can be parameterized to use a stack allocator.
The be
Reduced:
import std.stdio;
mixin template Foo() {
string data = "default";
}
class Bar {
string data;
mixin Foo f;
}
void check_data(alias M, T)(T obj) {
writeln(M.stringof);
writeln(obj.data);
writeln(obj.f.data);
}
void main() {
Bar bar = new Bar;
bar.data = "Bar";
bar.f.d
On 18.11.2012 16:46, Namespace wrote:
Ok, understood.
I hoped that I could create a better interface.
I think a good interface would be a generic array class/struct that can
be parameterized to use a stack allocator.
Ok, understood.
I hoped that I could create a better interface.
On 18.11.2012 16:21, bearophile wrote:
Tobias Pankrath:
Maybe the array is allocated in the frame of the constructor which is
lost afterwards.
That's probably right, you can't use alloca that way (It seems my answer
yesterday got lost).
Bye,
bearophile
I just took a look. It's in my mailbo
Tobias Pankrath:
Maybe the array is allocated in the frame of the constructor
which is lost afterwards.
That's probably right, you can't use alloca that way (It seems my
answer yesterday got lost).
Bye,
bearophile
On Sunday, 18 November 2012 at 01:55:48 UTC, Namespace wrote:
Code: http://dpaste.dzfl.pl/6ae9f91a
Can someone explain me these results (switch the version
statement from 'none' to 'all' in 'reserve')?
Is it possible that I blown the stack frame? If so: why and can
my code/idea work?
Maybe th
On 11/18/12 14:15, Namespace wrote:
> Why are there so many copies of my struct if I give it to writeln?
> http://dpaste.dzfl.pl/414e7d93
> This problem occurs even if I have a 'toString' method.
phobos/writeln design issue. It just always blindly copies the things
it needs to print/format. Unnece
Namespace:
Why are there so many copies of my struct if I give it to
writeln?
http://dpaste.dzfl.pl/414e7d93
This problem occurs even if I have a 'toString' method.
It looks the compiler is working correctly here. It seems a pure
Phobos/writeln problem.
Bye,
bearophile
On 11/18/2012 09:19 AM, Maxim Fomin wrote:
On Saturday, 17 November 2012 at 23:28:21 UTC, Timon Gehr wrote:
On 11/18/2012 12:14 AM, Manfred Nowak wrote:
Maxim Fomin wrote:
related to the issue?
... I can see that the definition is ambiguous. And if the coder
didnt't realize the ambiguousnes
On Sunday, 18 November 2012 at 10:19:47 UTC, Manfred Nowak wrote:
I will be quiet on this, because non formal specifications tend
to have ambiguities and I believe that the ambiguity I see
escapes the intended scope; but I am not willing to check for
this---and it is fruitless to explain such cas
On 2012-11-17 18:55, JN wrote:
DWT vs GtkD
Wiki (http://prowiki.org/wiki4d/wiki.cgi?GuiLibraries) claims
they are both "mature and ready to be used". How true is that?
As for my requirements - I'd like my app to run under Windows and
Linux, also it would be great if it was compilable under GDC.
Maxim Fomin wrote:
> How this is related
I will be quiet on this, because non formal specifications tend
to have ambiguities and I believe that the ambiguity I see
escapes the intended scope; but I am not willing to check for
this---and it is fruitless to explain such cases.
-manfred
On Saturday, 17 November 2012 at 23:28:21 UTC, Timon Gehr wrote:
On 11/18/2012 12:14 AM, Manfred Nowak wrote:
Maxim Fomin wrote:
related to the issue?
... I can see that the definition is ambiguous. And if the
coder
didnt't realize the ambiguousness as you do ...
-manfred
The code give
On Saturday, 17 November 2012 at 23:14:56 UTC, Manfred Nowak
wrote:
Maxim Fomin wrote:
related to the issue?
... I can see that the definition is ambiguous. And if the coder
didnt't realize the ambiguousness as you do ...
-manfred
There is compilation error when instantiating class templat
29 matches
Mail list logo