Thanks for the comments.
It seems that my best option is to avoid the built in AA's for
now. I'll take a look at the suggested alternative solutions.
One thing I'm looking for is enforced explicit additions of new
key value pairs rather than the magical method used by the built
in AA's, it's
On 3/28/13, cal wrote:
> Just realized that format.d is able to figure it out, since it
> prints #{overlap...} for unions. I can use that code, which works
> regardless of protection. Thanks
Ah, I didn't even know .tupleof would contain .offsetof.
void main()
{
static if (S.tupleof[0].offset
On Thursday, 28 March 2013 at 23:02:31 UTC, Timothee Cour wrote:
In code below, does transTable have a well defined type?
it seems to change from line 9 (string[char])
to line 10 (string[dchar])...
My guess:
The enum version is like saying this:
auto s = translate("[", ['[' : `\[`]);
here the
In code below, does transTable have a well defined type?
it seems to change from line 9 (string[char])
to line 10 (string[dchar])...
rdmd -version=bad main //CT erro
rdmd main //works
import std.string;
void main(){
version(bad){
auto transTable = ['[' : `\[`];
}
else{
On 03/28/2013 03:05 PM, Dmitry Olshansky wrote:
The built-in ones are a minefield for anything more complex then a
dictionary of string->int :)
Please, last I checked, they were still a minefield for that...
Random crashes, basic issues with the type system...
I just stopped using them...
Bu
On Thursday, 28 March 2013 at 20:18:45 UTC, Andrej Mitrovic wrote:
On Thursday, 28 March 2013 at 20:02:18 UTC, cal wrote:
.offsetof will also require access rights to the fields.
Just realized that format.d is able to figure it out, since it
prints #{overlap...} for unions. I can use that code
On Thu, Mar 28, 2013 at 08:45:42PM +0100, Rob T wrote:
> I recall some discussion about AA's being buggy and fixing the bugs
> is difficult, and that there may be future changes to how AA's
> operate, for example perhaps moving it to a library solution.
>
> So I am wondering if I should simply avo
On Thursday, 28 March 2013 at 20:18:45 UTC, Andrej Mitrovic wrote:
.offsetof will also require access rights to the fields.
Yeh this is the problem. I can map data layout of complex
aggregates, even if the members are private, but unions mess that
up. Restricting to public fields is an option
On Thursday, 28 March 2013 at 20:02:18 UTC, cal wrote:
is there any way to detect the fact that fields i and f will
have the same offset from S?
void main()
{
static if (S.init.i.offsetof == S.init.f.offsetof)
pragma(msg, "Union");
}
(Creating an instance of S and getting the relat
28-Mar-2013 23:45, Rob T пишет:
I recall some discussion about AA's being buggy and fixing the bugs is
difficult, and that there may be future changes to how AA's operate, for
example perhaps moving it to a library solution.
So I am wondering if I should simply avoid using the built-in AA's
enti
Given:
struct S {
union {
int i;
float f;
}
}
is there any way to detect the fact that fields i and f will have
the same offset from S? (Creating an instance of S and getting
the relative addresses only works if the union is public).
I recall some discussion about AA's being buggy and fixing the
bugs is difficult, and that there may be future changes to how
AA's operate, for example perhaps moving it to a library solution.
So I am wondering if I should simply avoid using the built-in
AA's entirely at this time, and instead
On Thursday, 28 March 2013 at 17:57:47 UTC, Tim wrote:
On Thursday, 28 March 2013 at 12:28:05 UTC, Martin Drasar wrote:
On 28.3.2013 11:23, Tim wrote:
Thanks Martin and Ali. Your solution works as long as I use
the
receive()-method, but what about using SocketStreams? I
replaced
socket.receive
On Thursday, 28 March 2013 at 12:28:05 UTC, Martin Drasar wrote:
On 28.3.2013 11:23, Tim wrote:
Thanks Martin and Ali. Your solution works as long as I use the
receive()-method, but what about using SocketStreams? I
replaced
socket.receive() with socketStream.readLine() which isn't
broken by t
Am 27.03.2013 20:04, schrieb Sean Kelly:
On Mar 26, 2013, at 11:37 AM, Benjamin Thaut wrote:
Am 25.03.2013 23:49, schrieb Sean Kelly:
On Mar 22, 2013, at 2:58 AM, Benjamin Thaut wrote:
So I want to install my own assertHandler. The problem is, that even if I call
"setAssetHandler" in a sh
Am 28.03.2013 08:15, schrieb Jacob Carlborg:
On 2013-03-22 10:58, Benjamin Thaut wrote:
So I want to install my own assertHandler. The problem is, that even if
I call "setAssetHandler" in a shared module constructor, and that module
does not import any other modules, it is still not initialized
On Thursday, 28 March 2013 at 14:16:27 UTC, Steven Schveighoffer
wrote:
I'm not sure what __aggr1174 is, but you can fix the e error by
specifying the type for e (or specifying it as const).
-Steve
This is a foolishness of dmd frontend. It generates names for
copies, temporaries, etc. These
On 2013-03-26 16:34, Dan wrote:
Hi -
I get some errors from this simple code:
class Class_a {
double[2][2] ob;
}
class Class_b : Class_a { int obb;}
Serializer.register!(Class_b);
The error is:
Error: variable
orange.serialization.Serializer.Serializer.serializeArray!(inout(double[2LU][2LU
On 2013-03-28 15:16, Steven Schveighoffer wrote:
Like Timon said, it's a bug in inout design.
I'm not sure what __aggr1174 is, but you can fix the e error by
specifying the type for e (or specifying it as const).
I'm assuming the issue is that the compiler is trying to generate a
struct to hol
well, closure is effectively a struct, so its fields should be
properly qualified, e.g. as const.
On Thu, 28 Mar 2013 04:34:36 -0400, Jacob Carlborg wrote:
The following code fails to compile:
void foo (inout int[] arr)
{
auto dg = {
foreach (i, e ; arr) {}
};
dg();
}
void main ()
{
auto a = [3, 4, 5];
foo(a);
}
Error message:
main.d(9): Error: variable
On Tuesday, 26 March 2013 at 14:26:59 UTC, cal wrote:
I guess the tuple version is fine, it is just surprising that
only one of the three parameter types can be directly matched.
It is also surprising that this example from the docs works:
Because 'Tuple' is a template, not a type.
Please reca
On 2013-03-26 16:34, Dan wrote:
Hi -
I get some errors from this simple code:
class Class_a {
double[2][2] ob;
}
class Class_b : Class_a { int obb;}
Serializer.register!(Class_b);
The error is:
Error: variable
orange.serialization.Serializer.Serializer.serializeArray!(inout(double[2LU][2LU
On 28.3.2013 11:23, Tim wrote:
> Thanks Martin and Ali. Your solution works as long as I use the
> receive()-method, but what about using SocketStreams? I replaced
> socket.receive() with socketStream.readLine() which isn't broken by the
> solution above...
If you check the documentation, you will
On 03/28/2013 09:34 AM, Jacob Carlborg wrote:
The following code fails to compile:
void foo (inout int[] arr)
{
auto dg = {
foreach (i, e ; arr) {}
};
dg();
}
void main ()
{
auto a = [3, 4, 5];
foo(a);
}
Error message:
main.d(9): Error: variable main.foo.__la
On Thursday, 28 March 2013 at 07:57:07 UTC, Martin Drašar wrote:
Dne 27.3.2013 22:38, Tim napsal(a):
Thanks! I've never used message passing and I'm currently a
bit confused
how it works (I came from the Java-area where message passing
isn't
necessary for something like that)... are there any
The following code fails to compile:
void foo (inout int[] arr)
{
auto dg = {
foreach (i, e ; arr) {}
};
dg();
}
void main ()
{
auto a = [3, 4, 5];
foo(a);
}
Error message:
main.d(9): Error: variable main.foo.__lambda1.__aggr1174 inout variables
can only be declare
Dne 27.3.2013 22:38, Tim napsal(a):
Thanks! I've never used message passing and I'm currently a bit confused
how it works (I came from the Java-area where message passing isn't
necessary for something like that)... are there any information/examples
about message passing? I sill can't get it to w
On 2013-03-22 10:58, Benjamin Thaut wrote:
So I want to install my own assertHandler. The problem is, that even if
I call "setAssetHandler" in a shared module constructor, and that module
does not import any other modules, it is still not initialized first. Is
there a way to set the assert before
29 matches
Mail list logo