Re: Convert little imperative code to functional coding style

2012-08-12 Thread Timon Gehr
On 08/10/2012 09:59 PM, Nathan M. Swan wrote: On Friday, 10 August 2012 at 18:26:56 UTC, Timon Gehr wrote: Is this what you are looking for? import std.stdio; import std.range : iota; import std.algorithm : map, filter, joiner; import std.typecons : tuple; import std.math : sqrt, floor; void

Re: Convert little imperative code to functional coding style

2012-08-11 Thread bioinfornatics
Le vendredi 10 août 2012 à 20:26 +0200, Timon Gehr a écrit : Is this what you are looking for? import std.stdio; import std.range: iota; import std.algorithm: map, filter, joiner; import std.typecons : tuple; import std.math : sqrt, floor; void main(){

Re: Convert little imperative code to functional coding style

2012-08-10 Thread Timon Gehr
Is this what you are looking for? import std.stdio; import std.range: iota; import std.algorithm: map, filter, joiner; import std.typecons : tuple; import std.math : sqrt, floor; void main(){ immutable limit = cast(size_t)floor(sqrt(1_000.0)); auto r =

Re: Convert little imperative code to functional coding style

2012-08-10 Thread Nathan M. Swan
On Friday, 10 August 2012 at 18:26:56 UTC, Timon Gehr wrote: Is this what you are looking for? import std.stdio; import std.range: iota; import std.algorithm: map, filter, joiner; import std.typecons : tuple; import std.math : sqrt, floor; void main(){ immutable

Convert little imperative code to functional coding style

2012-08-09 Thread bioinfornatics
Dear, i try convert a code to functional coding style: commented code is what i try to convert to functional ___ import std.stdio; import std.range; import std.algorithm; import std.conv : to; import std.typecons : tuple; import std.math