Re: Segmentation error at the end problem (148 line program listing)

2009-01-30 Thread Charles Hixson
grauzone wrote: Charles Hixson wrote: I replaced BlockFile.close with: void close() { if (bf !is null) delete bf;//bf.close; bf = null; } But that didn't alter the segmentation fault. (Did you try it under D1 or D2?) Your destructor calls close(), and close()

Re: Template Mixin issue

2009-01-30 Thread Christopher Wright
Christopher Wright wrote: Mike L. wrote: If the compiler can tell that B!(int) is a type, why can't it tell that it is a child class of A!(int) ? This is a bug. In template specializations, : means equality. In static if, : means convertibility. This is only with template specializations in

Re: UTF8 to ANSI (1.0)

2009-01-30 Thread Jarrett Billingsley
On Fri, Jan 30, 2009 at 5:56 PM, jicman wrote: > Greetings! > > I have done some research on the digitalmars.com for some d code showing UTF8 > to ANSI stuff, and there isn't anything that I can clearly use. > > Long story short, I have about 600+ files that I need to convert from UTF8 to > ANSI

UTF8 to ANSI (1.0)

2009-01-30 Thread jicman
Greetings! I have done some research on the digitalmars.com for some d code showing UTF8 to ANSI stuff, and there isn't anything that I can clearly use. Long story short, I have about 600+ files that I need to convert from UTF8 to ANSI. They have different languages characters. I can do open

Re: foreach/opApply is the visitor pattern

2009-01-30 Thread Jarrett Billingsley
On Fri, Jan 30, 2009 at 5:35 PM, BCS wrote: > Correct me if I'm wrong but I thing that D's opApply is a form of the > Visitor pattern where the calling function's stack frame is the visitor > object. Yeah. As far as I know it is.

foreach/opApply is the visitor pattern

2009-01-30 Thread BCS
Correct me if I'm wrong but I thing that D's opApply is a form of the Visitor pattern where the calling function's stack frame is the visitor object. This just occurred to me. Maybe I've been missing something re the visitor pattern but I think this make for a nice, cool and easy way to describ

Re: input

2009-01-30 Thread Michael P.
naama Wrote: > How am I get a integer nimber from the user? (readln()?) > > the command line is: > ??? import std.cstream; int number; din.readf( "%d", &number );

Re: casting int[] to bool[]

2009-01-30 Thread Don
Steven Schveighoffer wrote: "Don" wrote Steven Schveighoffer wrote: This is such a common "mistake", and really more of an annoyance, I wonder if it might be better if pow were switched to a template that called the actual pow after casting the first argument to real. Often times, one does n

Re: casting int[] to bool[]

2009-01-30 Thread Steven Schveighoffer
"Don" wrote > Steven Schveighoffer wrote: >> This is such a common "mistake", and really more of an annoyance, I >> wonder if it might be better if pow were switched to a template that >> called the actual pow after casting the first argument to real. Often >> times, one does not use reals as

input

2009-01-30 Thread naama
How am I get a integer nimber from the user? (readln()?) the command line is: ???

Re: problem with D compiler

2009-01-30 Thread naama
I do it, but I also get same answer. ??? > Saaa Wrote: > > > Did you set the environment variables? > > http://www.digitalmars.com/d/1.0/dmd-windows.html > > > > I do it, but I also get same answer. > ??? >

Re: problem with D compiler

2009-01-30 Thread naama
Saaa Wrote: > Did you set the environment variables? > http://www.digitalmars.com/d/1.0/dmd-windows.html > > I do it, but I also get same answer. ???

Re: Segmentation error at the end problem (148 line program listing)

2009-01-30 Thread grauzone
Charles Hixson wrote: I replaced BlockFile.close with: void close() { if (bf !is null) delete bf;//bf.close; bf = null; } But that didn't alter the segmentation fault. (Did you try it under D1 or D2?) Your destructor calls close(), and close() accesses the refe

Re: Template Mixin issue

2009-01-30 Thread Christopher Wright
Mike L. wrote: If the compiler can tell that B!(int) is a type, why can't it tell that it is a child class of A!(int) ? This is a bug. In template specializations, : means equality. In static if, : means convertibility. So, you can use: template ADefaults(Type, AType) { static asser

Re: casting int[] to bool[]

2009-01-30 Thread Don
Steven Schveighoffer wrote: "Jarrett Billingsley" wrote On Thu, Jan 29, 2009 at 6:15 PM, Saaa wrote: That gives the same error.. only casting x to real works :/ That's more an issue with D's extremely (overly?) strict overload resolution rules. Functions like sin() shouldn't be an issue, sin