Re: Can I call the default opAssign after overloading opAssign?

2012-11-25 Thread monarch_dodra
On Sunday, 25 November 2012 at 00:12:04 UTC, Rob T wrote: Thanks for pointing out where the postblit stuff is documented. When I first started learning the language, I did read that part a few times over, but I found it frustratingly hard to grasp. I will re-read that section again. This sh

Re: Complex C typedef decl replacement

2012-11-25 Thread Jacob Carlborg
On 2012-11-23 16:01, Mike Parker wrote: Should likely be extern(System), as OpenGL & GLU are extern(Windows) on Windows and extern(C) everywhere else. Right. -- /Jacob Carlborg

Re: Can I call the default opAssign after overloading opAssign?

2012-11-25 Thread Dan
On Sunday, 25 November 2012 at 11:05:37 UTC, monarch_dodra wrote: AFAIK, there is no "official spec". And even if there was, the "de-facto" spec *is* TDPL... minus everything that could have changed since it's printing. I think TDPL is great, but there is a doc called "D Language Specificat

Re: Can I call the default opAssign after overloading opAssign?

2012-11-25 Thread Jonathan M Davis
On Sunday, November 25, 2012 12:05:36 monarch_dodra wrote: > AFAIK, there is no "official spec". And even if there was, the > "de-facto" spec *is* TDPL... minus everything that could have > changed since it's printing. The online docs are the official spec. They're just not necessarily complete or

Re: constructor instead of opCall for an instance of a template alias

2012-11-25 Thread comco
A!B(...) defines a struct A with B typed in as Method, so call to method(s); is the same as B(string) Why is that? Here method is an instance of the type Method, not the type Method itself, so by saying `method(s)` we can't mean a constructor. Something very strange happens... I have a simple

Re: constructor instead of opCall for an instance of a template alias

2012-11-25 Thread Ali Çehreli
On 11/25/2012 07:27 AM, comco wrote: > >> A!B(...) defines a struct A with B typed in as Method, so call to >> method(s); is the same as B(string) > Why is that? Here method is an instance of the type Method, not the type > Method itself, That could be case but you original code did use a type na

Re: constructor instead of opCall for an instance of a template alias

2012-11-25 Thread Maxim Fomin
On Sunday, 25 November 2012 at 15:27:53 UTC, comco wrote: A!B(...) defines a struct A with B typed in as Method, so call to method(s); is the same as B(string) Why is that? Here method is an instance of the type Method, not the type Method itself, so by saying `method(s)` we can't mean a cons

Re: constructor instead of opCall for an instance of a template alias

2012-11-25 Thread comco
On Sunday, 25 November 2012 at 16:01:39 UTC, Ali Çehreli wrote: Could you please create a bug report: http://d.puremagic.com/issues/ Ali Filed an issue 9078.

Re: constructor instead of opCall for an instance of a template alias

2012-11-25 Thread Rob T
On Sunday, 25 November 2012 at 16:42:03 UTC, Maxim Fomin wrote: Recently I saw a major pull affecting this behavior, so in 2.061 the situation may be changed (I haven't bother to figure yet). In practice this makes a tricky thing to understand what S() is and creates a problem when you e.x. hea

Re: Converting a number to complex

2012-11-25 Thread Joshua Niehus
On Saturday, 24 November 2012 at 07:27:18 UTC, Philippe Sigaud wrote: It's an is() expression (you cited my tutorial, there is an appendix on it). It recently became even more powerful, so the tutorial is not accurate any more. its time for another read through:) Template constraints might ma

std.bigint: BigInt conversion

2012-11-25 Thread novice2
How i can convert ubyte[] to BigInt and BigInt to ubyte[] ? Or uint[]... For example, i need RSA crypto. I should get ubyte[] data, ubyte[] key, convert it to BigInt, calculate, then save result as ubyte[] data again. But i see BigInt convertable to string only :(

Re: std.bigint: BigInt conversion

2012-11-25 Thread Stian
On Sunday, 25 November 2012 at 21:36:38 UTC, novice2 wrote: How i can convert ubyte[] to BigInt and BigInt to ubyte[] ? Or uint[]... For example, i need RSA crypto. I should get ubyte[] data, ubyte[] key, convert it to BigInt, calculate, then save result as ubyte[] data again. But i see BigI

Libraries for machine learning or artificial intelligence.

2012-11-25 Thread Knud Soerensen
Hi Which D libraries exist for machine learning or artificial intelligence ? Or alternative what about libraries for linear algebra and statistic methods ? Knud

Re: Libraries for machine learning or artificial intelligence.

2012-11-25 Thread jerro
Or alternative what about libraries for linear algebra and statistic methods ? For statistics, there is dstats (https://github.com/dsimcha/dstats) and for linear algebra, there is scid (https://github.com/cristicbz/scid/).

Re: Error: SIMD vector types not supported on this platform

2012-11-25 Thread jerro
On Thursday, 22 November 2012 at 21:26:20 UTC, Michael wrote: On Wednesday, 8 August 2012 at 16:09:46 UTC, Simen Kjaeraas wrote: On Wed, 08 Aug 2012 15:46:23 +0200, ixid wrote: I'm using the recently released DMD2 version 2.060. SIMD operations are not supported for Windows at the moment,

Bug with offsetof?

2012-11-25 Thread Geancarlo
Hello, I'm using DMD32 D Compiler v2.060 for on Windows. module main; import std.stdio; int main(string[] argv) { writeln(TestStruct.x.offsetof); TestClass.test1(); TestClass var = new TestClass(); var.test2(); return 0; } class TestClass { stat

Re: Bug with offsetof?

2012-11-25 Thread Geancarlo
This also works fine: void test3() { TestStruct dummy; writeln(dummy.x.offsetof); }

Re: Bug with offsetof?

2012-11-25 Thread jerro
This works for me if I add parentheses to the line where you get the error like this: writeln(TestStruct().x.offsetof);//bug here The error you were getting is not related to offsetof. The problem seems to be that if you write TestStruct.x inside a non-static method, the compiler thinks you a

Re: Bug with offsetof?

2012-11-25 Thread Ali Çehreli
On 11/25/2012 07:23 PM, Geancarlo wrote: Hello, I'm using DMD32 D Compiler v2.060 for on Windows. module main; import std.stdio; int main(string[] argv) { writeln(TestStruct.x.offsetof); TestClass.test1(); TestClass var = new TestClass(); var.test2(); return 0; } class TestClass { static voi

Re: Bug with offsetof?

2012-11-25 Thread Geancarlo
Thanks jerro and Ali, I see your points. I thought offsetof was like C/C++'s sizeof... Guess while taking a crash course at a new language I will often bump into issues because I haven't read a specific doc.

Re: Bug with offsetof?

2012-11-25 Thread Jacob Carlborg
On 2012-11-26 05:49, Geancarlo wrote: Thanks jerro and Ali, I see your points. I thought offsetof was like C/C++'s sizeof... Guess while taking a crash course at a new language I will often bump into issues because I haven't read a specific doc. You do have .sizeof in D as well. -- /Jacob Carl

Re: Bug with offsetof?

2012-11-25 Thread Jacob Carlborg
On 2012-11-26 05:03, jerro wrote: This works for me if I add parentheses to the line where you get the error like this: writeln(TestStruct().x.offsetof);//bug here This will create an instance of TestStruct. -- /Jacob Carlborg