Re: just stop program

2010-11-07 Thread Lars T. Kyllingstad
On Fri, 05 Nov 2010 15:09:05 +, div0 wrote: > On 05/11/2010 10:14, Lars T. Kyllingstad wrote: >> On Fri, 05 Nov 2010 09:47:37 +, div0 wrote: >> >>> On 05/11/2010 09:32, spir wrote: Hello, Is there a way for a program to simply exit before end of main()? An instruction l

Re: just stop program

2010-11-07 Thread div0
On 07/11/2010 10:42, Lars T. Kyllingstad wrote: On Fri, 05 Nov 2010 15:09:05 +, div0 wrote: On 05/11/2010 10:14, Lars T. Kyllingstad wrote: On Fri, 05 Nov 2010 09:47:37 +, div0 wrote: On 05/11/2010 09:32, spir wrote: Hello, Is there a way for a program to simply exit before end of

Re: check type

2010-11-07 Thread spir
On Sat, 06 Nov 2010 20:50:05 -0400 bearophile wrote: > spir: > > > class SC { > > string f = "SC"; > > void show() {writeln(this.f);} > > } > > class C : SC { > > string f = "C"; > > } > > void main () { > > auto c = new C(); > > writeln(c.f) ; // OK, got "C" > > c.show(

Re: just stop program

2010-11-07 Thread spir
On Sun, 07 Nov 2010 11:00:04 + div0 wrote: > OIC, that makes sense. I guess people should be discourged from using > the C bits anyway; there ought to be better D versions of everyting in > the C standard lib. That make sense; or at least have the ones that need no improvement transparent

array of elements of various subclasses

2010-11-07 Thread spir
Hello, Say I have some subclasses of Pattern. When I try to write Pattern[] patterns = [x,y,z]; I get an error because, apparently, D types the array according to the class of z (Choice is here the type of z): DeeMatch.d(473): Error: cannot implicitly convert expression (x) of type Dee

Re: array of elements of various subclasses

2010-11-07 Thread spir
On Sun, 7 Nov 2010 16:17:38 +0100 spir wrote: And I'd like to know, as a possible workaround, if there is a way to save a variadic arg list: class C { ??? xs; this(X xs...) { this.xs = xs; } } Denis -- -- -- -- -- -- -- vit ess

Re: check type

2010-11-07 Thread Jesse Phillips
spir Wrote: > I just realised that what I was asking for is in fact class-level fields -- > common to all instances, instead of each instance having it locally. > Maybe you know the answer to that, but just in case you would use a static variable. class SC { static string f = "SC";

Re: array of elements of various subclasses

2010-11-07 Thread Jesse Phillips
spir Wrote: > Hello, > > > Say I have some subclasses of Pattern. When I try to write > Pattern[] patterns = [x,y,z]; > I get an error because, apparently, D types the array according to the class > of z (Choice is here the type of z): > > DeeMatch.d(473): Error: cannot implicitly conver

Re: array of elements of various subclasses

2010-11-07 Thread Jesse Phillips
spir Wrote: > On Sun, 7 Nov 2010 16:17:38 +0100 > spir wrote: > > And I'd like to know, as a possible workaround, if there is a way to save a > variadic arg list: > class C { > ??? xs; > this(X xs...) { > this.xs = xs; > } > } > > Denis >

Re: array of elements of various subclasses

2010-11-07 Thread Dmitry Olshansky
On 07.11.2010 18:49, spir wrote: On Sun, 7 Nov 2010 16:17:38 +0100 spir wrote: And I'd like to know, as a possible workaround, if there is a way to save a variadic arg list: class C { ??? xs; this(X xs...) { this.xs = xs; } }

Re: array of elements of various subclasses

2010-11-07 Thread spir
On Sun, 07 Nov 2010 20:29:40 +0300 Dmitry Olshansky wrote: > On 07.11.2010 18:49, spir wrote: > > On Sun, 7 Nov 2010 16:17:38 +0100 > > spir wrote: > > > > And I'd like to know, as a possible workaround, if there is a way to save a > > variadic arg list: > > class C { > > ??? xs; >

Re: array of elements of various subclasses

2010-11-07 Thread spir
On Sun, 07 Nov 2010 11:24:37 -0500 Jesse Phillips wrote: > > And I'd like to know, as a possible workaround, if there is a way to save a > > variadic arg list: > > class C { > > ??? xs; > > this(X xs...) { > > this.xs = xs; > > } > > } > > > > Denis >

Re: array of elements of various subclasses

2010-11-07 Thread Jesse Phillips
spir Wrote: > No, in fact a variadic param list is not an array -- this is according to > TDPL an iternal type of the language. Trying to assign it to an X[] var > throws: > DeeMatch.d(371): Error: cannot implicitly convert expression (patterns) of > type DeeMatch.Pattern to Pattern[] > Well, a

Re: array of elements of various subclasses

2010-11-07 Thread spir
On Sun, 07 Nov 2010 14:08:17 -0500 Jesse Phillips wrote: > spir Wrote: > > > No, in fact a variadic param list is not an array -- this is according to > > TDPL an iternal type of the language. Trying to assign it to an X[] var > > throws: > > DeeMatch.d(371): Error: cannot implicitly convert e

Re: array of elements of various subclasses

2010-11-07 Thread Don
spir wrote: Hello, Say I have some subclasses of Pattern. When I try to write Pattern[] patterns = [x,y,z]; I get an error because, apparently, D types the array according to the class of z (Choice is here the type of z): DeeMatch.d(473): Error: cannot implicitly convert expression (x

Re: [import,module] got biting again :(

2010-11-07 Thread Don
%u wrote: Yay, free access to a! I searched for this bug in the bug-reports.. Why are there so many basic import bugs? There's only really one. But it's huge.

Re: [import,module] got biting again :(

2010-11-07 Thread bearophile
Don: > There's only really one. But it's huge. Really? :-) I didn't know this. (You are very often right, but I have a hard time believing this). Bye, bearophile

Re: array of elements of various subclasses

2010-11-07 Thread Stewart Gordon
On 07/11/2010 15:49, spir wrote: And I'd like to know, as a possible workaround, if there is a way to save a variadic arg list: class C { ??? xs; this(X xs...) { this.xs = xs; } } What exactly are you trying to do here? If y