Re: Code-File structure

2012-06-12 Thread Nathan M. Swan
On Tuesday, 12 June 2012 at 07:04:15 UTC, Henrik Valter Vogelius Hansson wrote: Hi! I'm new to D and trying everything out. Got the basics down which are very straightforward and similar to other languages. My professional background is primarily in C/C++-variants and Ruby if it helps. I ha

Does D have high-performance sockets

2012-06-12 Thread D Day
Are there any implementations of this anywhere for D? I really only care about the windows platform - and have considered writing this myself with IOCP and std.socket, but I figure someone else must have already done something similar?

Re: Code-File structure

2012-06-12 Thread Henrik Valter Vogelius Hansson
On Tuesday, 12 June 2012 at 18:07:45 UTC, Francois Chabot wrote: On Tuesday, 12 June 2012 at 07:04:15 UTC, Henrik Valter Vogelius Hansson wrote: Hi! I'm new to D and trying everything out. Got the basics down which are very straightforward and similar to other languages. My professional backg

Re: From number of seconds in a day to a formatted time string

2012-06-12 Thread TJB
On Tuesday, 12 June 2012 at 17:40:40 UTC, Jonathan M Davis wrote: On Tuesday, June 12, 2012 19:28:38 TJB wrote: I am working with some financial data that comes in binary files. It has two fields in particular that I am trying to convert to human readable formats. The first is a date string lik

Re: Code-File structure

2012-06-12 Thread Francois Chabot
On Tuesday, 12 June 2012 at 07:04:15 UTC, Henrik Valter Vogelius Hansson wrote: Hi! I'm new to D and trying everything out. Got the basics down which are very straightforward and similar to other languages. My professional background is primarily in C/C++-variants and Ruby if it helps. I ha

Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
On Tuesday, 12 June 2012 at 15:51:31 UTC, Era Scarecrow wrote: On Tuesday, 12 June 2012 at 13:05:26 UTC, bearophile wrote: Are you able to support a syntax like: struct defs { mixin(bitfields!( bool, "b", 1, uint, "i=2", 3, short, "s=5", 4)); } That does look cleaner and better

Re: From number of seconds in a day to a formatted time string

2012-06-12 Thread Jonathan M Davis
On Tuesday, June 12, 2012 19:28:38 TJB wrote: > I am working with some financial data that comes in binary files. > It has two fields in particular that I am trying to convert to > human readable formats. The first is a date string like > "20060621", which I am able to work with just fine. But then

From number of seconds in a day to a formatted time string

2012-06-12 Thread TJB
I am working with some financial data that comes in binary files. It has two fields in particular that I am trying to convert to human readable formats. The first is a date string like "20060621", which I am able to work with just fine. But then it has a field called ttim, which is the number o

Re: static switch

2012-06-12 Thread cal
On Tuesday, 12 June 2012 at 08:35:44 UTC, Dmitry Olshansky wrote: It doesn't. It's easy to check anyway. Not for me :) I just saw that it worked, and wondered if it worked statically. Thanks!

Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
On Tuesday, 12 June 2012 at 13:05:26 UTC, bearophile wrote: Era Scarecrow: struct defs { mixin(bitfields_D!( bitfields!( //borrowed from std.bitmanip bool, "b", 1, uint, "i", 3, short, "s", 4), "i=2", "s=5")); } Are you able to support a syntax like: struct defs {

Re: bitfields - Default values?

2012-06-12 Thread Dmitry Olshansky
On 12.06.2012 17:05, bearophile wrote: Era Scarecrow: Are you able to support a syntax like: struct defs { mixin(bitfields!( bool, "b", 1, uint, "i=2", 3, short, "s=5", 4)); } Or iff bitfields is a mixin template: struct defs { mixin bitfields!( bool, "b", 1, uint, "i=2",

Re: Windows program instant crash: no messages.

2012-06-12 Thread Nekroze
OK, another update to the original download link. I have gotten initDarkGDK to pass and it gets all the way down to handing the screen over to DarkGDK using the wrapper function dbOpenScreen but fails after that. I guess then my problem is in the wrapper function or in the actual template th

Re: static switch

2012-06-12 Thread bearophile
cal: Does a switch statement acting on a template parameter act just like a chain of static if-else's? That is, does it just generate the code for the matching case? See: http://d.puremagic.com/issues/show_bug.cgi?id=6921 Bye, bearophile

Re: bitfields - Default values?

2012-06-12 Thread bearophile
Era Scarecrow: struct defs { mixin(bitfields_D!( bitfields!( //borrowed from std.bitmanip bool, "b", 1, uint, "i", 3, short, "s", 4), "i=2", "s=5")); } Are you able to support a syntax like: struct defs { mixin(bitfields!( bool, "b", 1, uint, "i=

Re: Idea: writeln and file functions that return the data passed to them

2012-06-12 Thread Dmitry Olshansky
On 12.06.2012 16:12, ixid wrote: Perhaps there is already a way to do this. With the UFCS one tends to make elegant chains of statements, it would be useful to have writeln and file functions that can easily be dropped in the middle of such chains without having to alter the lay out of one's prog

Idea: writeln and file functions that return the data passed to them

2012-06-12 Thread ixid
Perhaps there is already a way to do this. With the UFCS one tends to make elegant chains of statements, it would be useful to have writeln and file functions that can easily be dropped in the middle of such chains without having to alter the lay out of one's program. Rather than returning void

Re: Using C macros without massive rewrites

2012-06-12 Thread Andrej Mitrovic
On 6/12/12, Johannes Pfau wrote: > But for simple macros, gcc -E -dM can be useful. > gcc -E -dM '/usr/include/sys/types.h' This could be useful for me, thanks. More options: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Preprocessor-Options.html

Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
On Tuesday, 5 June 2012 at 00:17:08 UTC, bearophile wrote: Era Scarecrow: The documentation for bitfields doesn't go into detail if you can put any default values into it. Can you? I think you can't. See: http://d.puremagic.com/issues/show_bug.cgi?id=4425 Bye, bearophile K, I think I have

Re: Windows program instant crash: no messages.

2012-06-12 Thread Nekroze
On Tuesday, 12 June 2012 at 09:03:43 UTC, Andrew Wiley wrote: On Tue, Jun 12, 2012 at 1:50 AM, Andrew Wiley wrote: On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky wrote: On 12.06.2012 11:17, Nekroze wrote: Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine for windows

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:50 AM, Andrew Wiley wrote: > On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky > wrote: >> On 12.06.2012 11:17, Nekroze wrote: >>> >>> Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine >>> for windows with D and i am doing rather well so far. I have

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky wrote: > On 12.06.2012 11:17, Nekroze wrote: >> >> Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine >> for windows with D and i am doing rather well so far. I have just gotten >> it to successfully compile however the resultin

Re: static switch

2012-06-12 Thread Dmitry Olshansky
On 12.06.2012 10:13, cal wrote: Does a switch statement acting on a template parameter act just like a chain of static if-else's? That is, does it just generate the code for the matching case? enum E { A, B, C } class Blah(E param) { void foo() { switch(param) { case(E.A) : blah; case(E.B) : ..

Re: Windows program instant crash: no messages.

2012-06-12 Thread Dmitry Olshansky
On 12.06.2012 11:17, Nekroze wrote: Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine for windows with D and i am doing rather well so far. I have just gotten it to successfully compile however the resulting exe instantly crashes and outputs nothing at all even though the ver

Re: Using C macros without massive rewrites

2012-06-12 Thread Johannes Pfau
Am Tue, 12 Jun 2012 06:15:38 +0200 schrieb Alex Rønne Petersen : > On 12-06-2012 04:20, Charles McAnany wrote: > > Hi, all. I'm studying Kerrisk's The Linux Programming Interface for > > fun. The book is written in C, and I thought it would be fun to do > > the exercises in D. My problem is that I

Windows program instant crash: no messages.

2012-06-12 Thread Nekroze
Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine for windows with D and i am doing rather well so far. I have just gotten it to successfully compile however the resulting exe instantly crashes and outputs nothing at all even though the very first command in WinMain is writ

Code-File structure

2012-06-12 Thread Henrik Valter Vogelius Hansson
Hi! I'm new to D and trying everything out. Got the basics down which are very straightforward and similar to other languages. My professional background is primarily in C/C++-variants and Ruby if it helps. I have a problem with how modules, packages and files work. I don't really know how