Logo

Programming-Idioms

History of Idiom 19 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-08-20, 16:24:21

Version 7

2015-08-20, 16:25:03

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Imports
import std.range;
Imports
import std.range;
Code
auto y = x.retro;
Code
auto y = x.retro;
Comments bubble
This doesn't allocate a new list, but creates an iterator that traverses the list in reverse order.
Comments bubble
This doesn't allocate a new list or modify the original, but creates an iterator that traverses the list in reverse order.
Demo URL
http://dpaste.dzfl.pl/ebf4256b37c4
Demo URL
http://dpaste.dzfl.pl/ebf4256b37c4