Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-04-14 Thread Rikki Cattermole
On Monday, 14 April 2014 at 15:21:33 UTC, FrankLike wrote: Hello,everyone: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D? So lots of people want to use D,who can help them? They want to connect MS SQL Server in D,then they will connect other Da

Re: aliases and .stringof

2014-04-14 Thread evilrat
On Monday, 14 April 2014 at 19:01:22 UTC, Joseph Rushton Wakeling wrote: alias Graph = G!directed; ... writeln("Graph type: ", (Graph.directed) ? "directed " : "undirected ", Graph.stringof); // ... etc. isn't this should be Graph.typeof.stringof ?

aliases and .stringof

2014-04-14 Thread Joseph Rushton Wakeling
I noticed something odd with code of mine with recent D builds (recent from-git dmd, 2.065-branch ldc2). I have a loop in my graph library which goes: foreach (G; TypeTuple!(IndexedEdgeList, CachedEdgeList)) { foreach (directed; TypeTuple!(false, true)) { ali

Re: Converting function pointers to delegates

2014-04-14 Thread Andrej Mitrovic
On Monday, 14 April 2014 at 17:45:52 UTC, Ryan Voots wrote: /** * Convert any function pointer to a delegate. * _ From: http://www.digitalmars.com/d/archives/digitalmars You can replaced it with std.functional.toDelegate. As for its use-case, if some API or function supports only delegates

Converting function pointers to delegates

2014-04-14 Thread Ryan Voots
I'm porting some code from D1 to D2 and this is the final error i'm getting from DMD and GDC. I have no idea what is going on with it though. /** * Convert any function pointer to a delegate. * _ From: http://www.digitalmars.com/d/archives/digitalmars/D/easily_convert_any_method_function_to

Re: Converting function pointers to delegates

2014-04-14 Thread Andrej Mitrovic
On Monday, 14 April 2014 at 17:48:31 UTC, Adam D. Ruppe wrote: On Monday, 14 April 2014 at 17:45:52 UTC, Ryan Voots wrote: src/yage/core/misc.d(164): Error: e2ir: cannot cast this of type S to type void* Try taking the address of this before casting it. So more like cast(void*)&this IIRC i

Re: Converting function pointers to delegates

2014-04-14 Thread Adam D. Ruppe
On Monday, 14 April 2014 at 17:45:52 UTC, Ryan Voots wrote: src/yage/core/misc.d(164): Error: e2ir: cannot cast this of type S to type void* Try taking the address of this before casting it. So more like cast(void*)&this IIRC in D1 this was a pointer, whereas in D2 this is a reference. You

Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-04-14 Thread FrankLike
First thing a D programmer MUST do is 1) To port FreeTDS to D, or write a binding/wrapper for it (should not be too difficult). or 2) Use ODBC directly, or maybe also write some wrapper around it. or 3) Implement D connector to MS SQL server directly (I would advise against that, such

Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-04-14 Thread FrankLike
My advice - use ODBC, it is the fastest way you may connect to the SQL server, and you already have everything you need for that. :) Regards I have test the d\dmd2\windows\lib\odbc32.lib,the size is 4.5kb, I test it by test.d(build :dmd test.d) but find the error: Error 42:Symbol Undefined

Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-04-14 Thread Dejan Lekic
On Monday, 14 April 2014 at 15:21:33 UTC, FrankLike wrote: Hello,everyone: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D? So lots of people want to use D,who can help them? They want to connect MS SQL Server in D,then they will connect other Da

I test move the DFL to x64,there are some things,who will help me?

2014-04-14 Thread FrankLike
I test move the DFL to x64,there are some things,who will help me? When I move the DFL to x64,then find some error: internal\com.d(36):Error: cannot implicitly convert expression)C_refCountInc(cast(void*)this)) of type ulong to uint . I'm not sure that x86 to x64,the type ulong to uint? wh

Re: Implicit conversions through purity

2014-04-14 Thread bearophile
Steven Schveighoffer: For that reason, I would disallow out parameters from casting implicitly. If you think the proposal is not good, can you please copy what you have written here in the issue thread? https://issues.dlang.org/show_bug.cgi?id=12573 Bye, bearophile

A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-04-14 Thread FrankLike
Hello,everyone: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D? So lots of people want to use D,who can help them? They want to connect MS SQL Server in D,then they will connect other DataBase, because it's a good idea that nice thing come from t

Re: Implicit conversions through purity

2014-04-14 Thread Steven Schveighoffer
On Mon, 14 Apr 2014 06:37:18 -0400, Jonathan M Davis wrote: On Sunday, April 13, 2014 01:52:13 bearophile wrote: Jonathan M Davis: > Honestly, I would have considered that to be a bug. Converting > the return type > to a different level of mutability based on purity is one > thing. Automatic

Re: Rosettacode: program termination

2014-04-14 Thread bearophile
John Colvin: I think notInifnite is too contrived, you would always just use `else` there. This is more realistic: int notInfinite(in int b) pure nothrow { if (b < 0) return 10; if (b > 10) return 20; // In release mode this becomes a halt, and it's sometimes /

Re: Local function overloading

2014-04-14 Thread monarch_dodra
On Monday, 14 April 2014 at 10:35:20 UTC, Jonathan M Davis wrote: On Sunday, April 13, 2014 08:40:17 Philpax wrote: Is not being able to overload functions in local scope intended behaviour? Yes. IIRC, I complained about it at one point, and Walter didn't like the idea of having overloaded ne

Re: Implicit conversions through purity

2014-04-14 Thread Jonathan M Davis
On Sunday, April 13, 2014 21:21:02 Daniel Murphy wrote: > "Jonathan M Davis" wrote in message > news:mailman.112.1397351369.5999.digitalmars-d-le...@puremagic.com... > > > Honestly, I would have considered that to be a bug. Converting the return > > type > > to a different level of mutability bas

Re: Implicit conversions through purity

2014-04-14 Thread Jonathan M Davis
On Sunday, April 13, 2014 01:52:13 bearophile wrote: > Jonathan M Davis: > > Honestly, I would have considered that to be a bug. Converting > > the return type > > to a different level of mutability based on purity is one > > thing. Automatically > > casting the return value just because the functi

Re: Local function overloading

2014-04-14 Thread Jonathan M Davis
On Sunday, April 13, 2014 08:40:17 Philpax wrote: > Is not being able to overload functions in local scope intended > behaviour? Yes. IIRC, I complained about it at one point, and Walter didn't like the idea of having overloaded nested functions. I don't remember what his reasoning was, but I do

Uncaught exception while running redis-pubsub-example of vibe.d

2014-04-14 Thread Elvis Zhou
Running ./redis-pubsub-example Callback subscribe(["test1"]) Task terminated with uncaught exception: expected of $ or * The error message gives no hint of where the exception is raised.How do you guys debug this type of error?

Rosettacode: program termination

2014-04-14 Thread bearophile
I have added a D entry regarding how to terminate D programs. What's missing? http://rosettacode.org/wiki/Program_termination#D Bye, bearophile

Re: Rosettacode: program termination

2014-04-14 Thread John Colvin
On Monday, 14 April 2014 at 09:58:09 UTC, bearophile wrote: I have added a D entry regarding how to terminate D programs. What's missing? http://rosettacode.org/wiki/Program_termination#D Bye, bearophile I think notInifnite is too contrived, you would always just use `else` there. This is m