Re: object splitting in multiple threads

2009-01-10 Thread downs
Jarrett Billingsley wrote: On Sat, Jan 10, 2009 at 12:30 AM, Jarrett Billingsley jarrett.billings...@gmail.com wrote: On Sat, Jan 10, 2009 at 12:18 AM, yes y...@no.com wrote: Does Phobos also do threadpools? From what I understand, not without modification. At least, not efficiently. Downs

linking with c

2009-01-10 Thread Mike
So I'm trying to link a C file to be used in a D program: hw.c: #include stdio.h void hw() { printf(Hello, world!); } hw_main.d: module hw_main; extern (C) void hw(); int main() { hw(); return 0; } I compile the C file with dmc: dmc -c hw.c and the D file with

Re: linking with c

2009-01-10 Thread Jason House
Mike wrote: So I'm trying to link a C file to be used in a D program: I compile the C file with dmc: dmc -c hw.c and the D file with dmd: dmd -c hw_main.d I usually keep it simple and do: dmd main.d hw.obj

Re: using a typedefed variable with library classes

2009-01-10 Thread Bill Baxter
On Sun, Jan 11, 2009 at 8:23 AM, Charles Hixson charleshi...@earthlink.net wrote: Is it possible to use a typedefed variable with library classes? In particular, what I've done is: typedef int TestType; TestType t; File f; t = 42; f.write (t); And the response I get is the

Re: using a typedefed variable with library classes

2009-01-10 Thread bearophile
Bill Baxter: I've never found a use for typedef myself. I don't think it's used much, In Pascal (and its variant and children, like ObjectPascals, etc) there is a section named Type where you define your typedefs. People used to program in Pascal-like languages (ObjectPascals, Ada, Oberon,

Re: using a typedefed variable with library classes

2009-01-10 Thread Bill Baxter
On Sun, Jan 11, 2009 at 10:16 AM, bearophile bearophileh...@lycos.com wrote: Bill Baxter: I've never found a use for typedef myself. I don't think it's used much, In Pascal (and its variant and children, like ObjectPascals, etc) there is a section named Type where you define your typedefs.

Foreach problem

2009-01-10 Thread Tim M
Why is this an error. Dmd wants to make sure that I declare a new variable in the foreach statement and not use an existing one? module test; void main() { int i; int[] nums; foreach(i; nums) { // } } dmd test.d test.d(7): Error:

Re: Foreach problem

2009-01-10 Thread Daniel Keep
Tim M wrote: Why is this an error. Dmd wants to make sure that I declare a new variable in the foreach statement and not use an existing one? module test; void main() { int i; int[] nums; foreach(i; nums) { // } } dmd test.d test.d(7): Error: shadowing

Re: Foreach problem

2009-01-10 Thread Tim M
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep daniel.keep.li...@gmail.com wrote: Tim M wrote: Why is this an error. Dmd wants to make sure that I declare a new variable in the foreach statement and not use an existing one? module test; void main() { int i; int[] nums;

Re: Foreach problem

2009-01-10 Thread Tim M
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep daniel.keep.li...@gmail.com wrote: Tim M wrote: Why is this an error. Dmd wants to make sure that I declare a new variable in the foreach statement and not use an existing one?

Re: Foreach problem

2009-01-10 Thread Bill Baxter
On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote: Why does it still work for some objects? This works: module test; class A { this() { // } } class B { this()

Re: Foreach problem

2009-01-10 Thread Tim M
On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wbax...@gmail.com wrote: On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote: Why does it still work for some objects? This works: module test; class A { this()

Re: Foreach problem

2009-01-10 Thread Bill Baxter
On Sun, Jan 11, 2009 at 12:15 PM, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wbax...@gmail.com wrote: On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote: Why does it still work for some objects?

Re: Foreach problem

2009-01-10 Thread Denis Koroskin
On Sun, 11 Jan 2009 06:04:01 +0300, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote: On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep daniel.keep.li...@gmail.com wrote: Tim M wrote: Why is this an error. Dmd wants to make sure that I declare a new