Re: SQLite library on Windows

2012-12-26 Thread BLM768
On Thursday, 27 December 2012 at 03:03:34 UTC, jose isaias cabrera wrote: I have a huge project with D1 using the old DDBI project in dsource: http://dsource.org/projects/ddbi It would be nice if someone with time will port it to D2. IHTH. jic Actually, my current project is basically al

Re: SQLite library on Windows

2012-12-26 Thread jose isaias cabrera
"BLM768" ... > Has anyone managed to get the library working on Windows? I have a huge project with D1 using the old DDBI project in dsource: http://dsource.org/projects/ddbi It would be nice if someone with time will port it to D2. IHTH. jic

Re: SQLite library on Windows

2012-12-26 Thread evilrat
On Thursday, 27 December 2012 at 01:45:26 UTC, BLM768 wrote: I've been trying various methods to get SQLite working in Windows using the etc.c.sqlite3 bindings, but I can't figure out how to get everything in a form that DMD likes. GCC doesn't seem to output anything that OPTLINK can use, and I

SQLite library on Windows

2012-12-26 Thread BLM768
I've been trying various methods to get SQLite working in Windows using the etc.c.sqlite3 bindings, but I can't figure out how to get everything in a form that DMD likes. GCC doesn't seem to output anything that OPTLINK can use, and I can't use the standard DLL build without creating a .LIB fil

Re: structs are now lvalues - what is with "auto ref"?

2012-12-26 Thread Namespace
On Wednesday, 26 December 2012 at 22:33:38 UTC, Jonathan M Davis wrote: On Wednesday, December 26, 2012 10:43:53 Namespace wrote: Quick question: what is the state of things with dmd 2.061 AFAIK, it's exactly the same as it was in 2.060. - Jonathan M Davis I mean, when it comes out. But tha

Re: structs are now lvalues - what is with "auto ref"?

2012-12-26 Thread Jonathan M Davis
On Wednesday, December 26, 2012 10:43:53 Namespace wrote: > Quick question: what is the state of things with dmd 2.061 AFAIK, it's exactly the same as it was in 2.060. - Jonathan M Davis

Re: Regex - replace example fails for more than 6 digits

2012-12-26 Thread Peter Summerland
On Wednesday, 26 December 2012 at 21:16:30 UTC, Dmitry Olshansky wrote: 12/26/2012 9:26 PM, Peter Summerland пишет: I tried the example from the std.regex documentation: //Comify a number auto com = regex(r"(?<=\d)(?=(\d\d\d)+\b)","g"); assert(replace("12000 + 42100 = 54100", com, ",") == "12,0

Re: Regex - replace example fails for more than 6 digits

2012-12-26 Thread Dmitry Olshansky
12/26/2012 9:26 PM, Peter Summerland пишет: I tried the example from the std.regex documentation: //Comify a number auto com = regex(r"(?<=\d)(?=(\d\d\d)+\b)","g"); assert(replace("12000 + 42100 = 54100", com, ",") == "12,000 + 42,100 = 54,100"); It did not work for me when I entered numbers wi

Re: cast(A)b is not an lvalue

2012-12-26 Thread Andrej Mitrovic
On 12/26/12, Maxim Fomin wrote: >> static if (!is(typeof(writeln))) >> alias writefln writeln; >> > What does this for? I constantly face in code samples shared in > this NG. Probably for D1 compatibility. D1 didn't have writeln.

Re: cast(A)b is not an lvalue

2012-12-26 Thread Namespace
On Wednesday, 26 December 2012 at 19:52:21 UTC, Maxim Fomin wrote: On Wednesday, 26 December 2012 at 17:13:14 UTC, Ali Çehreli wrote: Here is the code: import std.stdio; static if (!is(typeof(writeln))) alias writefln writeln; What does this for? I constantly face in code samples sh

Re: cast(A)b is not an lvalue

2012-12-26 Thread Maxim Fomin
On Wednesday, 26 December 2012 at 17:13:14 UTC, Ali Çehreli wrote: Here is the code: import std.stdio; static if (!is(typeof(writeln))) alias writefln writeln; What does this for? I constantly face in code samples shared in this NG.

Re: cast(A)b is not an lvalue

2012-12-26 Thread monarch_dodra
On Wednesday, 26 December 2012 at 19:45:53 UTC, monarch_dodra wrote: On Wednesday, 26 December 2012 at 17:13:14 UTC, Ali Çehreli wrote: On 12/26/2012 09:05 AM, Namespace wrote: I can answer the question in the subject line without looking at dpaste: Yes, in many cases the result of a cast opera

Re: cast(A)b is not an lvalue

2012-12-26 Thread monarch_dodra
On Wednesday, 26 December 2012 at 17:13:14 UTC, Ali Çehreli wrote: On 12/26/2012 09:05 AM, Namespace wrote: I can answer the question in the subject line without looking at dpaste: Yes, in many cases the result of a cast operation is an rvalue. It is a temporary that is constructed at the spot

Re: aliasing superclass constructors

2012-12-26 Thread Maxim Fomin
On Wednesday, 26 December 2012 at 17:11:31 UTC, Nick Treleaven wrote: On 26/12/2012 15:13, Maxim Fomin wrote: The problem is that Exception class ctor requires at least one explicit argument (https://github.com/D-Programming-Language/druntime/blob/master/src/object.di#L339). To solve the prob

Re: is(T == const) for function types

2012-12-26 Thread mist
On Wednesday, 26 December 2012 at 00:47:28 UTC, Ali Çehreli wrote: On 12/25/2012 04:13 PM, bearophile wrote: Ali Çehreli: I don't know the answer but this works: That difference smells of compiler bug :-) Bye, bearophilee Hmmm. I think the compiler is right. That const that is applied "a

Any D libraries for natural language processing ?

2012-12-26 Thread Knud Soerensen
Is there Any D libraries for natural language processing or text processing ? Knud

Re: cast(A)b is not an lvalue

2012-12-26 Thread Ali Çehreli
On 12/26/2012 09:05 AM, Namespace wrote: I can answer the question in the subject line without looking at dpaste: Yes, in many cases the result of a cast operation is an rvalue. It is a temporary that is constructed at the spot for that cast operation. Imagine casting an int to a double. The fou

Re: aliasing superclass constructors

2012-12-26 Thread Nick Treleaven
On 26/12/2012 15:13, Maxim Fomin wrote: The problem is that Exception class ctor requires at least one explicit argument (https://github.com/D-Programming-Language/druntime/blob/master/src/object.di#L339). To solve the problem in general case you can either supply default arguments for all ctor

Re: cast(A)b is not an lvalue

2012-12-26 Thread Namespace
I can answer the question in the subject line without looking at dpaste: Yes, in many cases the result of a cast operation is an rvalue. It is a temporary that is constructed at the spot for that cast operation. Imagine casting an int to a double. The four bytes of the int is nowhere close to

Re: cast(A)b is not an lvalue

2012-12-26 Thread Ali Çehreli
On 12/26/2012 07:37 AM, Namespace wrote: > If I don't comment out line 19 I get: > /home/c803/c821.d(19): Error: function c821.foo (ref A a) is not > callable using argument types (B) > /home/c803/c821.d(19): Error: cast(A)b is not an lvalue > > Code: http://dpaste.dzfl.pl/89f55c62 > > Should not

Re: Reflection: Get all inherited classes of a base class

2012-12-26 Thread Adam D. Ruppe
On Tuesday, 25 December 2012 at 18:26:29 UTC, nrgyzer wrote: Thanks Adam, that's exactly what I need... is it possible to call a static method only using TypeInfo_Class or do I need to call the constructor using create-method? No, to call a static method you'd have to get to the compile time

cast(A)b is not an lvalue

2012-12-26 Thread Namespace
If I don't comment out line 19 I get: /home/c803/c821.d(19): Error: function c821.foo (ref A a) is not callable using argument types (B) /home/c803/c821.d(19): Error: cast(A)b is not an lvalue Code: http://dpaste.dzfl.pl/89f55c62 Should not work all three?

Re: aliasing superclass constructors

2012-12-26 Thread Maxim Fomin
On Wednesday, 26 December 2012 at 14:38:45 UTC, Nick Treleaven wrote: Hi, Is there an easy way to forward/expose all the constructors of a parent class? Just curious. Here are my attempts: class EFoo : Exception { //alias typeof(super).this this;// line 12 //alias typeo

Re: Reflection: Get all inherited classes of a base class

2012-12-26 Thread Jacob Carlborg
On 2012-12-25 19:26, nrgyzer wrote: Thanks Adam, that's exactly what I need... is it possible to call a static method only using TypeInfo_Class or do I need to call the constructor using create-method? I think using annotation would be very helpful for my idea: As far as I know you cannot call

aliasing superclass constructors

2012-12-26 Thread Nick Treleaven
Hi, Is there an easy way to forward/expose all the constructors of a parent class? Just curious. Here are my attempts: class EFoo : Exception { //alias typeof(super).this this;// line 12 //alias typeof(super).__ctor __ctor;// line 13 } uncommenting line 12: superthi

Re: structs are now lvalues - what is with "auto ref"?

2012-12-26 Thread Namespace
Quick question: what is the state of things with dmd 2.061 and I see that right, that "auto ref" is more complicated than first thought? :/