alias foo.bar this?

2009-08-21 Thread Lutger
The following doesn't compile, I was wondering whether this is a temporary limitation, bug or by design? struct Bar { int baz; } struct Foo { Bar bar; alias bar.baz this; // error }

Re: Structs by ref in D2

2009-08-21 Thread Lutger
By const ref seems reasonable to allow, but by ref is bug prone. Why is it handy?

Export static data

2009-08-21 Thread Dan
Is there a way to export static data from a DLL written in D? I'd like to write some extension DLLs for a program, but they need to have certain static data exports to be recognized. I've been able to export functions, but no data appears in the export table of the DLL. In MSVC 6 I can do it

Re: Structs by ref in D2

2009-08-21 Thread Daniel Keep
Steven Schveighoffer wrote: ... The issue is possibly with ref. There are two reasons to use ref, 1 is to be able to change the data referenced, 2 is for passing speed. 1 is bad for rvalues. 2 should be ok for rvalues. If there was a way to signify you only want to use ref for

Re: Export static data

2009-08-21 Thread Jarrett Billingsley
On Fri, Aug 21, 2009 at 11:10 AM, Dandan.r.stev...@gmail.com wrote: Is there a way to export static data from a DLL written in D? I'd like to write some extension DLLs for a program, but they need to have certain static data exports to be recognized. I've been able to export functions, but

Re: alias foo.bar this?

2009-08-21 Thread Bill Baxter
On Fri, Aug 21, 2009 at 2:47 AM, Lutgerlutger.blijdest...@gmail.com wrote: The following doesn't compile, I was wondering whether this is a temporary limitation, bug or by design? struct Bar {    int baz; } struct Foo {    Bar bar;    alias bar.baz this; // error } Problem I would

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chad J wrote: Regarding template mixins, I'm curious, why is the decision to mixin a template made at the call site and not at the declaration of the template/mixin? In other words, why do we write template foo() {

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread Jarrett Billingsley
On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: Not sure what the original choice was based on, but what you suggest looks wrong to me. You aren't necessarily using a template in order to mix it in somewhere. With that syntax it looks like you can only use foo as a

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jarrett Billingsley wrote: On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: That's what he's suggesting, and it does make sense. When you write a template, *either* it's meant to be used as a mixin, *or* it's meant to be

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread Bill Baxter
On Fri, Aug 21, 2009 at 10:36 AM, div0d...@users.sourceforge.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chad J wrote: Regarding template mixins, I'm curious, why is the decision to mixin a template made at the call site and not at the declaration of the template/mixin? In

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread Ary Borenszweig
div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jarrett Billingsley wrote: On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: That's what he's suggesting, and it does make sense. When you write a template, *either* it's meant to be used as a mixin, *or* it's

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ary Borenszweig wrote: div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jarrett Billingsley wrote: On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: That's what he's suggesting, and it does make sense. When you

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread Ary Borenszweig
div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ary Borenszweig wrote: div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jarrett Billingsley wrote: On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: That's what he's suggesting, and it does make sense.

Re: Template mixins: Why is the decision to mixin made at the call site?

2009-08-21 Thread Steven Schveighoffer
On Fri, 21 Aug 2009 13:54:38 -0400, div0 d...@users.sourceforge.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jarrett Billingsley wrote: On Fri, Aug 21, 2009 at 1:36 PM, div0d...@users.sourceforge.net wrote: That's what he's suggesting, and it does make sense. When you write a

Re: Structs by ref in D2

2009-08-21 Thread bearophile
Daniel Keep: In my own code, I usually record my intent by using inout for variables I intend to modify and ref for ones which I don't. Always seemed reasonable to me. for the compiler they mean the same thing, but inout is being deprecated. Bye, bearophile