Idiomatic adjacent_difference
    Guillaume Chatelet via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Fri Oct 16 05:17:25 PDT 2015
    
    
  
On Friday, 16 October 2015 at 12:03:56 UTC, Per Nordlöw wrote:
> On Friday, 16 October 2015 at 11:48:19 UTC, Edwin van Leeuwen 
> wrote:
>> zip(r, r[1..$]).map!((t) => t[1]-t[0]);
>
> And for InputRanges (not requiring random-access):
>
> zip(r, r.dropOne).map!((t) => t[1]-t[0]);
That's neat. Thx guys :)
    
    
More information about the Digitalmars-d-learn
mailing list