Re: Threading errors.

2010-07-27 Thread Philippe Sigaud
On Tue, Jul 27, 2010 at 19:03, Sean Kelly wrote: > The next release, 2.048, should bring things in line with TDPL. I had > meant to do this for 2.047, but was too busy with other work to finish in > time. > Do you mean, indexing tuples directly by a CT value as in msg[1]? Because that was the o

Re: D1->D2 member call syntax regression?

2010-07-27 Thread Nick Sabalausky
"bearophile" wrote in message news:i2nqs5$js...@digitalmars.com... > It seems to work, on 2.042, and on dmd 2.047: > http://ideone.com/dcsK3 > > Bye, > bearophile That's because my original example accidentally made Foo an uninstantiated class template, so the compiler never bothered to check t

Re: D1->D2 member call syntax regression?

2010-07-27 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:i2o9ev$1e4...@digitalmars.com... > "bearophile" wrote in message > news:i2nqs5$js...@digitalmars.com... >> It seems to work, on 2.042, and on dmd 2.047: >> http://ideone.com/dcsK3 >> >> Bye, >> bearophile > > That's because my original example accidentall

Re: How do I get an array from filter's result?

2010-07-27 Thread Jonathan M Davis
On Tuesday, July 27, 2010 17:24:27 Nick Sabalausky wrote: > On 2.047, this: > > import std.algorithm; > import std.array; > void main() > { > string[] result = > array( > filter!( (string a) { return a != "b"; } ) > (["a", "b", "c"]) > ); > } > > Gives

How do I get an array from filter's result?

2010-07-27 Thread Nick Sabalausky
On 2.047, this: import std.algorithm; import std.array; void main() { string[] result = array( filter!( (string a) { return a != "b"; } ) (["a", "b", "c"]) ); } Gives me this: testfilter.d(6): Error: template std.array.array(Range) if (isForwardRange!

Re: D1->D2 member call syntax regression?

2010-07-27 Thread bearophile
It seems to work, on 2.042, and on dmd 2.047: http://ideone.com/dcsK3 Bye, bearophile

Re: D1->D2 member call syntax regression?

2010-07-27 Thread Jonathan M Davis
On Tuesday, July 27, 2010 16:25:28 Nick Sabalausky wrote: > In converting some D1 code to D2, I noticed this doesn't seem to work > anymore: > > module mymodule; > class Foo() > { > void bar(string s) {...} > > void foo() > { > string str = "hello"; > str.bar(); >

D1->D2 member call syntax regression?

2010-07-27 Thread Nick Sabalausky
In converting some D1 code to D2, I noticed this doesn't seem to work anymore: module mymodule; class Foo() { void bar(string s) {...} void foo() { string str = "hello"; str.bar(); } } In D1 that works fine, but in D2 (2.047) it complains that it can't find "mym

Re: D2 map trouble

2010-07-27 Thread Dmitry Olshansky
On 28.07.2010 3:06, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message news:i2no7g$eu...@digitalmars.com... Trying to convert some D1 code to D2: On 2.047, I'm trying to do this: import std.string; void foo(string str) { str = std.algorithm.map!( (char a) { return inPattern(a,

Re: D2 map trouble

2010-07-27 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:i2no7g$eu...@digitalmars.com... > Trying to convert some D1 code to D2: > > On 2.047, I'm trying to do this: > > import std.string; > void foo(string str) > { > str = > std.algorithm.map!( > (char a) { return inPattern(a, [digits, letters])? a : '_'; } >

D2 map trouble

2010-07-27 Thread Nick Sabalausky
Trying to convert some D1 code to D2: On 2.047, I'm trying to do this: import std.string; void foo(string str) { str = std.algorithm.map!( (char a) { return inPattern(a, [digits, letters])? a : '_'; } )(str); } And I'm getting: delegate std.algorithm.__dgliteral1 cannot access frame of f

Re: struct opCall error messages

2010-07-27 Thread Jacob Carlborg
On 2010-07-26 14:27, Rory Mcguire wrote: Hi, I'm not sure this is in bugzilla, I tried finding something mentioning it but coudn't. Compiling the below code results in the dmd compiler printing: struct_bad_error.d(8): Error: 'this' is only defined in non-static member functions, not inner

Re: Threading errors.

2010-07-27 Thread Sean Kelly
The next release, 2.048, should bring things in line with TDPL. I had meant to do this for 2.047, but was too busy with other work to finish in time.

Re: D and cygwin io.

2010-07-27 Thread Rory Mcguire
dcoder wrote: > Hello. Here's a short program that works in a dos window: > > import std.stdio; > > void main() { > > writef( "What is your name?"); > > string name = readln(); > writefln( "Hello " ~ name); > } > > The program prints a prompt without a newline and the user enters a nam

Re: Threading errors.

2010-07-27 Thread dcoder
== Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article > Philippe Sigaud wrote: > >> > Also, in my case, the return; in writer must be commented out, or DMD > >> > complains it cannot be reached. > >> > > > > > >> > >> Interesting, I didn't have to comment out return; using dmd 2.047 on > >

D and cygwin io.

2010-07-27 Thread dcoder
Hello. Here's a short program that works in a dos window: import std.stdio; void main() { writef( "What is your name?"); string name = readln(); writefln( "Hello " ~ name); } The program prints a prompt without a newline and the user enters a name and a greeting is printed. The same pr

Re: Threading errors.

2010-07-27 Thread Rory Mcguire
Philippe Sigaud wrote: > On Tue, Jul 27, 2010 at 11:25, Rory Mcguire > wrote: > >> >> > Also, in my case, the return; in writer must be commented out, or DMD >> > complains it cannot be reached. >> > > >> >> Interesting, I didn't have to comment out return; using dmd 2.047 on >> linux >> > >

Re: Threading errors.

2010-07-27 Thread Philippe Sigaud
On Tue, Jul 27, 2010 at 11:25, Rory Mcguire wrote: > > > Also, in my case, the return; in writer must be commented out, or DMD > > complains it cannot be reached. > > > Interesting, I didn't have to comment out return; using dmd 2.047 on linux > I think I have -w (warnings treated as errors?)

Re: Threading errors.

2010-07-27 Thread Rory Mcguire
Philippe Sigaud wrote: > On Mon, Jul 26, 2010 at 19:11, dcoder wrote: > >> == Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article >> > Dmitry Olshansky wrote: >> > > > std.typecons.Tuple fields cannot be indexed like arrays, Andrei made a > mistake. To access field #n, use ._n or .fie