Re: output minimal .di files?

2012-01-16 Thread Adam Wilson
On Sun, 15 Jan 2012 03:53:05 -0800, F i L witte2...@gmail.com wrote: Given the code, test.d: import std.stdio; export void test() { writeln(Test); } compiled with: # dmd -lib -H test.d I end up with test.lib (good so far), and test.di: import std.stdio;

Re: output minimal .di files?

2012-01-16 Thread Jonathan M Davis
On Monday, January 16, 2012 00:14:02 Adam Wilson wrote: I'm assuming that your goal is to build either or static or dynamic libraries? If that is the case than you can assume that CTFE and inlining will not work anyways. This is an inherent limitation of libraries and not D. What D

std.math and std.mathspecial

2012-01-16 Thread Jun
import std.math; import std.mathspecial; import std.stdio; void main(string[] args) { writeln(erf(0.5)); } I was writing on my phone, so I couldn't add some code. And, my pc browser won't load digitalmars.D html page, either, so I post this again here. It was okay before... maybe server

Re: OOP Windows

2012-01-16 Thread Robert Clipsham
On 16/01/2012 00:34, DNewbie wrote: Is there a D version of this type of tutorial? https://www.relisoft.com/win32/index.htm This might be related to what you want: https://github.com/AndrejMitrovic/DWinProgramming -- Robert http://octarineparrot.com/

Re: A tutorial on D templates

2012-01-16 Thread Simen Kjærås
On Fri, 13 Jan 2012 22:21:52 +0100, Philippe Sigaud philippe.sig...@gmail.com wrote: There is an 'Examples' section where I show what can be done with templates and there I 'borrowed' some code posted here, with attribution. I already exchanged with Andrej Mitrovic (thanks!), but also took

Re: OOP Windows

2012-01-16 Thread Andrej Mitrovic
On 1/16/12, Robert Clipsham rob...@octarineparrot.com wrote: https://github.com/AndrejMitrovic/DWinProgramming I think he's looking for an OOP approach, that code is basically C translated to D. There are some OOP libraries he can use, like DGUI or DFL. And there are some OOP wrappers for

Re: OOP Windows

2012-01-16 Thread Andrej Mitrovic
Oh I thought that tutorial was about MFC/ATL, but it seems to use the regular C API. I might look into this to add it to the DWinProgramming project if it's worthwhile.

Error: template instance ... is not a template declaration, it is a function

2012-01-16 Thread Matej Nanut
Hey everyone, I've gotten that error before but I don't know how I removed it. I don't see what's wrong, it seems to work most of the time, but not always. I'm sure there's a reasonable explanation and my understanding of the matter lacks somewhat. What exactly does it mean? I'm trying to use

Re: output minimal .di files?

2012-01-16 Thread Adam Wilson
On Mon, 16 Jan 2012 00:25:21 -0800, Jonathan M Davis jmdavisp...@gmx.com wrote: On Monday, January 16, 2012 00:14:02 Adam Wilson wrote: I'm assuming that your goal is to build either or static or dynamic libraries? If that is the case than you can assume that CTFE and inlining will not work

std.stream.Stream.read([...]) matches both

2012-01-16 Thread Nrgyzer
Hi, I used Stream.read(out float) to read bytes of my stream. It worked for 2.056, but when I try to compile my code using 2.057 I get the following message: ((shared(float))) matches both: std.stream.Stream.read(out float x) and: std.stream.Stream.read(out real x) Because of

Struct initialization, implicit conversions and delegates

2012-01-16 Thread Nicolas Silva
Hi, I have two syntactic difficulties when initializing structs: 1) Say I have a struct StringHash that represents the hash code of a string. struct StringHash { this( string str ) { computeHash(str); } void computeHash( string str ) { hash = 0;

Re: output minimal .di files?

2012-01-16 Thread Alex Rønne Petersen
On 16-01-2012 21:08, H. S. Teoh wrote: On Mon, Jan 16, 2012 at 11:38:15AM -0800, Adam Wilson wrote: [...] I would say the main reason for using .h/.di files in libraries is that the library designer does not want his implementation public viewable. And in D, unlike C/C++, .di files are pretty

Re: output minimal .di files?

2012-01-16 Thread H. S. Teoh
On Mon, Jan 16, 2012 at 09:32:57PM +0100, Alex Rønne Petersen wrote: [...] I... don't think the error messages from expanding raw object code would be very pleasant to read, if you used a template incorrectly... [...] It doesn't have to be *executable* object code; the compiler may store extra

Re: output minimal .di files?

2012-01-16 Thread H. S. Teoh
On Mon, Jan 16, 2012 at 12:32:01PM -0800, Adam Wilson wrote: On Mon, 16 Jan 2012 12:08:53 -0800, H. S. Teoh hst...@quickfur.ath.cx wrote: [...] One way to implement this is to store template/inline function bodies inside the precompiled object files as extra info that the compiler loads in

Re: Struct initialization, implicit conversions and delegates

2012-01-16 Thread Trass3r
StringHash sh = SomeString; // ok That's the only thing that works. An @implicit tag for constructors to allow all implicit conversions would really be helpful. In general we need finer control of implicit conversions. Just have a look at ProxyOf:

Re: OOP Windows

2012-01-16 Thread DNewbie
On Mon, Jan 16, 2012, at 05:59 PM, Andrej Mitrovic wrote: On 1/16/12, Robert Clipsham rob...@octarineparrot.com wrote: https://github.com/AndrejMitrovic/DWinProgramming I think he's looking for an OOP approach, that code is basically C translated to D. There are some OOP libraries he can

Re: OOP Windows

2012-01-16 Thread bls
On 01/16/2012 09:07 AM, Andrej Mitrovic wrote: Oh I thought that tutorial was about MFC/ATL, but it seems to use the regular C API. I might look into this to add it to the DWinProgramming project if it's worthwhile. I think it is worth a closer look. Especially Bartosz Milewski ActiveObject

Re: A tutorial on D templates

2012-01-16 Thread Philippe Sigaud
On Mon, Jan 16, 2012 at 17:36, Simen Kjærås simen.kja...@gmail.com wrote: The extended enum example does not compile, because you've removed the unittest{} block around the the tests. I'd say the code in your document should compile straight out of the box, to be newb-friendly. Yeah. I just

Re: output minimal .di files?

2012-01-16 Thread Timon Gehr
On 01/16/2012 09:40 PM, H. S. Teoh wrote: On Mon, Jan 16, 2012 at 09:32:57PM +0100, Alex Rønne Petersen wrote: [...] I... don't think the error messages from expanding raw object code would be very pleasant to read, if you used a template incorrectly... [...] It doesn't have to be

Error: 'this' is only defined in non-static member functions, not parse

2012-01-16 Thread Matej Nanut
Hey everyone, I, once again, have a problem with an error I can't seem to figure out! The situation: - a class, inherited by five other classes; - the class having a static function which returns one if its subclasses depending on the input of a string. Something like this: class Node {

Re: OOP Windows

2012-01-16 Thread Andrej Mitrovic
On 1/16/12, bls bizp...@orange.fr wrote: I quess my question is : using CAIRO or GDI+ as Graphic engine for DGUI. Does DGUI intend to become cross-platform at any time? If not, then you could pick whichever system you're used to the most. You wouldn't be limited to just GDI+ if that's what DGUI

Re: output minimal .di files?

2012-01-16 Thread H. S. Teoh
On Tue, Jan 17, 2012 at 12:17:18AM +0100, Timon Gehr wrote: On 01/16/2012 09:40 PM, H. S. Teoh wrote: On Mon, Jan 16, 2012 at 09:32:57PM +0100, Alex Rønne Petersen wrote: [...] I... don't think the error messages from expanding raw object code would be very pleasant to read, if you used a

Re: Error: 'this' is only defined in non-static member functions, not parse

2012-01-16 Thread Timon Gehr
On 01/17/2012 12:49 AM, Matej Nanut wrote: Hey everyone, I, once again, have a problem with an error I can't seem to figure out! The situation: - a class, inherited by five other classes; - the class having a static function which returns one if its subclasses depending on the input of a

Re: OOP Windows

2012-01-16 Thread Jesse Phillips
On Monday, 16 January 2012 at 21:52:09 UTC, DNewbie wrote: Yes. I know a bit of C (not C++) and the Windows API. Now I'd like to learn more about OOP. I'm not really sure if that is the best strategy for learning OOP, even in C++. Though I guess it could give the before an after effect of an

Meaning of pure member function

2012-01-16 Thread H. S. Teoh
The following code compiles without error: class C { int x; // what does 'pure void' mean?? pure void f() { x++;// why is this legal? } } What does 'pure' mean when applied to a

Re: Meaning of pure member function

2012-01-16 Thread Jesse Phillips
On Tuesday, 17 January 2012 at 05:16:33 UTC, H. S. Teoh wrote: The following code compiles without error: class C { int x; // what does 'pure void' mean?? pure void f() { x++;// why is this legal?