Re: D serialization temporary fixup?

2015-10-23 Thread Atila Neves via Digitalmars-d-learn
On Thursday, 22 October 2015 at 16:15:23 UTC, Shriramana Sharma wrote: I wanted a D equivalent to: http://doc.qt.io/qt-5/qdatastream.html https://docs.python.org/3/library/pickle.html and saw that one is under construction: http://wiki.dlang.org/Review/std.serialization But till it's finali

Re: error detected at """ ch in unicode.C """ Library error?

2015-10-23 Thread rumbu via Digitalmars-d-learn
My opinion is to use the Tango's unicodedata.d module to obtain the unicode category, std.uni does not provide such functionality. This module does not have any dependency, therefore you can just use it directly: https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/text/UnicodeData.d#L169

Mixin template parameter that is an undefined variable

2015-10-23 Thread tcak via Digitalmars-d-learn
[code] mixin template Test(alias a){ int a; } void main(){ mixin Test!blah; } [/code] Compiler says it doesn't know about "blah". My purpose is to define the parameter as a variable. Is that possible?

Re: Mixin template parameter that is an undefined variable

2015-10-23 Thread John Colvin via Digitalmars-d-learn
On Friday, 23 October 2015 at 12:22:49 UTC, tcak wrote: [code] mixin template Test(alias a){ int a; } void main(){ mixin Test!blah; } [/code] Compiler says it doesn't know about "blah". My purpose is to define the parameter as a variable. Is that possible? you would have to us

Default method implementations in interfaces?

2015-10-23 Thread pineapple via Digitalmars-d-learn
Is it possible to have default method implementations in interfaces à la Java in D? Or some equivalent that allows multiple inheritance without a bunch of identical copypasted method bodies?

Re: Default method implementations in interfaces?

2015-10-23 Thread Alex Parrill via Digitalmars-d-learn
On Friday, 23 October 2015 at 14:58:43 UTC, pineapple wrote: Is it possible to have default method implementations in interfaces à la Java in D? Or some equivalent that allows multiple inheritance without a bunch of identical copypasted method bodies? Use template mixins: http://dlang.org/tem

Re: Default method implementations in interfaces?

2015-10-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 23 October 2015 at 14:58:43 UTC, pineapple wrote: Is it possible to have default method implementations in interfaces à la Java in D? Or some equivalent that allows multiple inheritance without a bunch of identical copypasted method bodies? Use a mixin template together with your i

Invalid assembler comparison

2015-10-23 Thread Etienne Cimon via Digitalmars-d-learn
Hello, I've been trying to understand this for a while now: https://github.com/etcimon/botan/blob/master/source/botan/math/mp/mp_core.d#L765 This comparison (looking at it with windbg during cmp operation) has these invalid values in the respective registers: rdx: 9366584610601550696 r15: 84

Re: Invalid assembler comparison

2015-10-23 Thread Etienne Cimon via Digitalmars-d-learn
On Friday, 23 October 2015 at 15:17:43 UTC, Etienne Cimon wrote: Hello, I've been trying to understand this for a while now: https://github.com/etcimon/botan/blob/master/source/botan/math/mp/mp_core.d#L765 This comparison (looking at it with windbg during cmp operation) has these invalid valu

Re: Default method implementations in interfaces?

2015-10-23 Thread pineapple via Digitalmars-d-learn
On Friday, 23 October 2015 at 15:07:05 UTC, Alex Parrill wrote: Use template mixins: http://dlang.org/template-mixin.html On Friday, 23 October 2015 at 15:08:30 UTC, Adam D. Ruppe wrote: Use a mixin template together with your interface. Awesome, thanks! No way, though, to unite declaration

Re: Default method implementations in interfaces?

2015-10-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/23/15 10:58 AM, pineapple wrote: Is it possible to have default method implementations in interfaces à la Java in D? Or some equivalent that allows multiple inheritance without a bunch of identical copypasted method bodies? If the idea is to have an implementation that *doesn't* get overr

Re: D serialization temporary fixup?

2015-10-23 Thread Shriramana Sharma via Digitalmars-d-learn
Shriramana Sharma wrote: > I'd just like to have a quick but reliable way to > store real and int data types into a binary data file and read therefrom. > Is there such a solution? Wow thank you people! Nice to know I can do rawWrite and also have other options. BTW is there a reason that eith

OT: The Genius Famine

2015-10-23 Thread Laeeth Isharc via Digitalmars-d-learn
Since there are some highly creative and intelligent people here, self-selected to be those who enjoy working on problems that are intrinsically interesting, I thought one or two people might enjoy reading some extracts from a forthcoming book on the topic of creative accomplishment and the end

Re: Overloading an imported function

2015-10-23 Thread Maxim Fomin via Digitalmars-d-learn
On Wednesday, 21 October 2015 at 12:05:27 UTC, Shriramana Sharma wrote: import std.math; real round(real val, int prec) { real pow = 10 ^^ prec; return round(val * pow) / pow; } Trying to compile this I get: foo.d(5): Error: function foo.round (real val, int prec) is not callable using

Re: error detected at """ ch in unicode.C """ Library error?

2015-10-23 Thread Charles Hixson via Digitalmars-d-learn
On 10/23/2015 04:33 AM, rumbu via Digitalmars-d-learn wrote: My opinion is to use the Tango's unicodedata.d module to obtain the unicode category, std.uni does not provide such functionality. This module does not have any dependency, therefore you can just use it directly: https://github.c