Re: rdmd only works with files in current directory on Windows?

2010-08-22 Thread Nick Sabalausky
"Lars T. Kyllingstad" wrote in message news:i47vkc$2vb...@digitalmars.com... > On Sat, 14 Aug 2010 14:58:05 +0200, simendsjo wrote: > >> c:\temp\src\test.d >> >> c:\temp>rdmd src\test >> The system cannot find the path specified. >> >> c:\temp>rdmd src/test >> std.file.FileException: (...)\.rdmd\

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread bearophile
Andrej Mitrovic: > Well, honestly, I would never use this flexibility to begin with. I'm not > seeing much benefits in having modules named in one way while keeping them > disorganized and in completely different folders. That just causes confusion, > for both the programmer and the build tools

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Andrej Mitrovic
Thanks, that works. Interesting how it's pretty much a 1:1 translation from the MSDN documentation to D code. I'm going to give more of these functions a try. Yao G. Wrote: >

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
On Sun, 22 Aug 2010 15:23:23 -0500, Andrej Mitrovic wrote: Thanks, that works. Interesting how it's pretty much a 1:1 translation from the MSDN documentation to D code. Yes. And in fact, that's what I did ;) I just copied/pasted the struct and function definition from the MSDN page. T

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:i4rnl4$239...@digitalmars.com... > Well then I think I've found some new bugs in RDMD & xfbuild: > > Files: > root/main.d > root/socket.d > > main.d: > module main; > > import alt.socket; > > void main() > { >foo(); > } > > socket.d: > module alt.socket

Re: template deduction

2010-08-22 Thread bearophile
> but it's not nice, maybe you can improve it, I have had to use a delegate > because > I have found a forward reference problem (I am not sure if it's worth for > Bugzilla): This was one problem, but maybe there are other ones: struct Foo(alias f) {} Foo!main baz; void main() {} I have added

Re: Can't get D calling C to build.

2010-08-22 Thread Bob Cowdery
On 22/08/2010 20:57, bearophile wrote: > Bob Cowdery: >> Well, the link still works but the download is 0 bytes so I guess its >> not available. Thanks for the thought. > That links works for me :-) > Be happy, bye, > bearophile Works if I paste it but not straight from the email,odd.

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Andrej Mitrovic
I see. Well, honestly, I would never use this flexibility to begin with. I'm not seeing much benefits in having modules named in one way while keeping them disorganized and in completely different folders. That just causes confusion, for both the programmer and the build tools. Personally, I'l

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
On Sun, 22 Aug 2010 14:36:50 -0500, Andrej Mitrovic wrote: I did a mistake in the code. If you want to use the UTF-8 version of GetVersionInfoEx, declare it like this: BOOL GetVersionExA( LPOSVERSIONINFO lpVersionInfo ); alias GetVersionExA GetVersionEx; And make the change to the T

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
On Sun, 22 Aug 2010 14:36:50 -0500, Andrej Mitrovic wrote: There's an example of a module constructor in TDPL. I don't think it's supossed to compile as it is, but I wanted to try it out anyway. I need a way to call the windows c function GetVersionEx. A grep through the source files doe

Re: Can't get D calling C to build.

2010-08-22 Thread bearophile
Bob Cowdery: > Well, the link still works but the download is 0 bytes so I guess its > not available. Thanks for the thought. That links works for me :-) Be happy, bye, bearophile

Re: template deduction

2010-08-22 Thread bearophile
Mafi: > I am not able to instatiate ths template in any way. You are doing it wrong. Such template tricks are not easy to get right, so probably the best thing you may do is to start from an empty program that works, and then keep adding to it, and keep it working, until you reach something goo

Re: Can't get D calling C to build.

2010-08-22 Thread Bob Cowdery
On 21/08/2010 22:41, Johannes Pfau wrote: > On 21.08.2010 23:07, Bob Cowdery wrote: >> For me at least I'm wondering if it stacks up. Linux support seems >> secondary (correct me if I'm wrong). The only painless way to use C >> libraries is as dll's and even then the import library must be convert

How do you call GetVersionEx (Windows)?

2010-08-22 Thread Andrej Mitrovic
There's an example of a module constructor in TDPL. I don't think it's supossed to compile as it is, but I wanted to try it out anyway. I need a way to call the windows c function GetVersionEx. A grep through the source files doesn't find it (except in the DMD cpp backend which it internally us

Re: Can't get D calling C to build.

2010-08-22 Thread Bob Cowdery
On 22/08/2010 00:54, div0 wrote: > On 21/08/2010 22:07, Bob Cowdery wrote: >> On 20/08/2010 18:44, div0 wrote: >>> On 20/08/2010 09:17, Bob Cowdery wrote: I'm still concerned it's a bit too soon as a lot of things seem to be either Windows or Linux (cmake says its only tested for

Re: floor, ceil equivalent

2010-08-22 Thread Yao G.
On Sun, 22 Aug 2010 13:49:26 -0500, Blonder wrote: I am looking for a floor/ceil function in D, is there an equivalent function, I haven't found any yet. Floor: http://digitalmars.com/d/2.0/phobos/std_math.html#floor Ceil: http://digitalmars.com/d/2.0/phobos/std_math.html#ceil -- Yao G.

floor, ceil equivalent

2010-08-22 Thread Blonder
Hello, I am looking for a floor/ceil function in D, is there an equivalent function, I haven't found any yet. Thanks.

template deduction

2010-08-22 Thread Mafi
Hey, I've written some caching template which should cache the return values. It looks like this: // template cached(F : R function(P), R, P...) { R cached(P p) { static R[Tuple!(P)] cache = []; R* pointer = Tuple!(P)(p) in cache; if(pointer !is null) {

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Andrej Mitrovic
Well then I think I've found some new bugs in RDMD & xfbuild: Files: root/main.d root/socket.d main.d: module main; import alt.socket; void main() { foo(); } socket.d: module alt.socket; import std.stdio : writeln; void foo() { writeln("test"); } $ RDMD main.d main.d(2): Error: mod

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Mafi
Am 22.08.2010 16:39, schrieb Andrej Mitrovic: That's very interesting. But wouldn't that cause problems if you're using package labels in some of those modules? AFAIK package gives access to all files in the current directory, so even if you "move" a module by changing the module declaration,

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Andrej Mitrovic
That's very interesting. But wouldn't that cause problems if you're using package labels in some of those modules? AFAIK package gives access to all files in the current directory, so even if you "move" a module by changing the module declaration, the files in the current directory will still

Re: dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

2010-08-22 Thread Rory Mcguire
Andrej Mitrovic wrote: > Doh! I swear I've read somewhere that a module declaration needs to have > the same name as the *file name*. I didn't know I had to add the path as > well. That makes the modules work now. > > In fact, I probably just read this one line in the docs: > > "The ModuleDeclar