Re: Little quiz

2011-03-28 Thread bearophile
Kai Meyer: > auto f2 = foo().tupleof; Thank you. From the output of this line of code the problem seems not caused by the static foreach. Bye, bearophile

Re: Little quiz

2011-03-28 Thread Kai Meyer
On 03/24/2011 06:50 PM, bearophile wrote: A little quiz for people here: guess the output of this little D2 program (it compiles correctly and doesn't crash at run time, so it's a fair question): import std.typecons: tuple; import std.c.stdio: printf; auto foo() { pri

Re: Little quiz

2011-03-25 Thread Kagamin
bearophile Wrote: > A little quiz for people here: guess the output of this little D2 program (it > compiles correctly and doesn't crash at run time, so it's a fair question): > > > import std.typecons: tuple; > import std.c.stdio: printf; > > auto foo() { &

Re: Little quiz

2011-03-25 Thread Jacob Carlborg
On 2011-03-25 12:32, bearophile wrote: Jacob Carlborg: I would guess it prints the values of all the fields in the struct returned by "tuple". That was of course my purpose, because tuples are a way to implement multiple return values, and in some situations I want to print all the items of

Re: Little quiz

2011-03-25 Thread bearophile
Jacob Carlborg: > I would guess it prints the values of all the fields in the struct > returned by "tuple". That was of course my purpose, because tuples are a way to implement multiple return values, and in some situations I want to print all the items of such return tuple, on separated lines

Re: Little quiz

2011-03-25 Thread Jacob Carlborg
On 2011-03-25 01:50, bearophile wrote: A little quiz for people here: guess the output of this little D2 program (it compiles correctly and doesn't crash at run time, so it's a fair question): import std.typecons: tuple; import std.c.stdio: printf; auto foo() { pri

Re: Little quiz

2011-03-24 Thread Jesse Phillips
bearophile Wrote: > A little quiz for people here: guess the output of this little D2 program (it > compiles correctly and doesn't crash at run time, so it's a fair question): > > > import std.typecons: tuple; > import std.c.stdio: printf; > > auto foo() { &

Re: Little quiz

2011-03-24 Thread spir
On 03/25/2011 01:50 AM, bearophile wrote: A little quiz for people here: guess the output of this little D2 program (it compiles correctly and doesn't crash at run time, so it's a fair question): import std.typecons: tuple; import std.c.stdio: printf; auto foo() { pri

Little quiz

2011-03-24 Thread bearophile
A little quiz for people here: guess the output of this little D2 program (it compiles correctly and doesn't crash at run time, so it's a fair question): import std.typecons: tuple; import std.c.stdio: printf; auto foo() { printf("foo\n"); return tuple