Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-30 Thread safety0ff via Digitalmars-d-learn
Just for fun: // map, join, text, iota, writeln, tuple import std.algorithm, std.array, std.conv, std.range, std.stdio, std.typecons; void main() { iota(1,100) .map!(a = tuple(a, a % 3 == 0 ? 0 : 4, a % 5 == 0 ? 8 : 4)) .map!(a = a[1] == a[2] ? a[0].text :

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-29 Thread Atila Neves via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]:

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]:

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread Idan Arye via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 11:03:09 UTC, bearophile wrote: Gary Willoughby: I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. Is this OK? void main() { import std.stdio, std.algorithm, std.range, std.conv, std.functional;

Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread Gary Willoughby via Digitalmars-d-learn
After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]: http://en.wikipedia.org/wiki/Fizz_buzz

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread bearophile via Digitalmars-d-learn
Gary Willoughby: I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. Is this OK? void main() { import std.stdio, std.algorithm, std.range, std.conv, std.functional; 100 .iota .map!(i = ((i + 1) % 15).predSwitch(

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread w0rp via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]:

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread wobbles via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 11:04:12 UTC, w0rp wrote: On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 13:59:48 UTC, Ivan Kazmenko wrote: On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1]

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 16:06:16 UTC, Andrea Fontana wrote: On Tuesday, 28 April 2015 at 13:59:48 UTC, Ivan Kazmenko wrote: On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: