Re: mysql

2013-04-17 Thread simendsjo
On Tuesday, 16 April 2013 at 21:09:42 UTC, gedaiu wrote: On Monday, 15 April 2013 at 19:25:19 UTC, simendsjo wrote: On Monday, 15 April 2013 at 17:34:07 UTC, gedaiu wrote: Hi, Can anyone help me to connect to mysql from D? Thanks! You can use Steve Teales native library. The most up-to-date

Re: refuses to open file

2013-04-17 Thread Ali Çehreli
On 04/17/2013 04:48 PM, rbt...@digitalpath.net wrote: I said: > That doesn't look right: char is a UTF-8 code unit. Unless you are sure > that the file contains UTF-8, I recommend you use something else, e.g. > ubyte. You said: > It' a pure ascii file. That means that every byte value in the

Re: foo is not an lvalue

2013-04-17 Thread Ellery Newcomer
On 04/17/2013 06:02 PM, bearophile wrote: Ellery Newcomer: dmd from master (a few days ago) gives: Error: foo()() is not an lvalue wut? I think you need to write: auto a = &foo!(); Bye, bearophile wouldn't that be infinitely recursing template instantiation?

Re: foo is not an lvalue

2013-04-17 Thread bearophile
Ellery Newcomer: dmd from master (a few days ago) gives: Error: foo()() is not an lvalue wut? I think you need to write: auto a = &foo!(); Bye, bearophile

foo is not an lvalue

2013-04-17 Thread Ellery Newcomer
void main() { foo!(); } template foo( ) { void foo() { auto a = (&foo); } } dmd from master (a few days ago) gives: Error: foo()() is not an lvalue wut?

Re: refuses to open file

2013-04-17 Thread rbtwms
Is it really "defile" that gets printed up there, or is that another typo? I highly recommend that you provide a complete program for us to try. spell checker got away from me. This time it seems to be complaining about a space *after* the file name! (?) makes no difference. I have a vague recoll

Re: refuses to open file

2013-04-17 Thread Ali Çehreli
On 04/17/2013 02:57 PM, rbt...@digitalpath.net wrote: > I had made so many changes truing to solve the problem that I included a > older version. another problem is that with the file name: efile = > File("l:\\filepro\\mvmammach\\key") with no space before the drive letter > the silently quits wi

Re: refuses to open file

2013-04-17 Thread rbtwms
I had made so many changes truing to solve the problem that I included a older version. another problem is that with the file name: efile = File("l:\\filepro\\mvmammach\\key") with no space before the drive letter the silently quits with no error but as you can see efile name is just a hex number.(

Re: Copying reference types by value

2013-04-17 Thread Ali Çehreli
On 04/17/2013 10:09 AM, Joseph Rushton Wakeling wrote: > On 04/17/2013 06:54 PM, Ali Çehreli wrote: >> I haven't used it anywhere but I did think about this very issue just the other >> day. I thought about defining a takeOver() member function that does what you need: >> >>// take over th

Re: Use enum base type?

2013-04-17 Thread Janissary
On Wednesday, 17 April 2013 at 18:56:43 UTC, Simen Kjaeraas wrote: On 2013-04-17, 19:15, Janissary wrote: Is it possible to evaluate an enum's base type? Ideally something like: enum somestrs : string { ... } enum d = 0.0; template EnumBaseType(E) if (is(E==enum)) { ... } unittest { static

Re: Use enum base type?

2013-04-17 Thread Simen Kjaeraas
On 2013-04-17, 19:15, Janissary wrote: Is it possible to evaluate an enum's base type? Ideally something like: enum somestrs : string { ... } enum d = 0.0; template EnumBaseType(E) if (is(E==enum)) { ... } unittest { static assert( is(EnumBaseType!somestrs == string) ); static assert( i

Use enum base type?

2013-04-17 Thread Janissary
Is it possible to evaluate an enum's base type? Ideally something like: enum somestrs : string { ... } enum d = 0.0; template EnumBaseType(E) if (is(E==enum)) { ... } unittest { static assert( is(EnumBaseType!somestrs == string) ); static assert( is(EnumBaseType!d : float) ); static ass

Re: Copying reference types by value

2013-04-17 Thread Joseph Rushton Wakeling
On 04/17/2013 06:54 PM, Ali Çehreli wrote: > I haven't used it anywhere but I did think about this very issue just the > other > day. I thought about defining a takeOver() member function that does what you > need: > > // take over the members of b > a.takeOver(b); // b becomes null (or .ini

Re: Copying reference types by value

2013-04-17 Thread Ali Çehreli
On 04/17/2013 09:17 AM, Joseph Rushton Wakeling wrote: > Defining a .dup method doesn't seem appropriate either because although it > allows me to duplicate the values, setting > >a = b.dup; > > will mean that a now becomes a new object, and any other entities that were > pointing at the o

Copying reference types by value

2013-04-17 Thread Joseph Rushton Wakeling
Hello all, Suppose I have a couple of variables a, b that are reference types (e.g. arrays or classes). Then, setting a = b will mean that the two reference the same entity. If they're arrays, one can copy the values readily by setting a[] = b[], but this isn't a generic solution -- suppose ins

Re: mysql

2013-04-17 Thread Rob T
On Tuesday, 16 April 2013 at 21:09:42 UTC, gedaiu wrote: On Monday, 15 April 2013 at 19:25:19 UTC, simendsjo wrote: On Monday, 15 April 2013 at 17:34:07 UTC, gedaiu wrote: Hi, Can anyone help me to connect to mysql from D? Thanks! You can use Steve Teales native library. The most up-to-date

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:17:03 +0100, Tofu Ninja wrote: On Wednesday, 17 April 2013 at 11:02:24 UTC, Regan Heath wrote: True, but this is what I'd call a short term view of encapsulation and code quality. Thinking about encapsulation in the short term is important because it forces you to p

Re: Ref and class function calls?

2013-04-17 Thread Tofu Ninja
On Wednesday, 17 April 2013 at 11:02:24 UTC, Regan Heath wrote: True, but this is what I'd call a short term view of encapsulation and code quality. Thinking about encapsulation in the short term is important because it forces you to properly design things for the long term. If you don't car

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:02:25 +0100, Regan Heath wrote: So, ultimately encapsulation (one aspect of good design) should lead to code which is better in every measurable way, including running faster. It may not have been 100% clear what I was implying here. Because encapsulation makes the

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Tue, 16 Apr 2013 18:51:06 +0100, Tofu Ninja wrote: On Tuesday, 16 April 2013 at 15:23:56 UTC, Regan Heath wrote: I would question always question "fully intended" on a case by case basis: http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197 I agree that grouping

Re: refuses to open file

2013-04-17 Thread John Colvin
On Wednesday, 17 April 2013 at 01:41:58 UTC, rbt...@paradiseca.com wrote: File efile; writefln("command line %s", args[]); if(args.length == 3) { type = to!int( args[1] ); // writefln("args[2] is: %s",args[2]); } if (args.length == 2) { efile = File(args[2]);