Reverse (keyword)
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
The reverse query operator can be used to reverse the order of a sequence, causing it to be looped backwards. This operator takes no additional parameters, and can be applied anywhere within a query. If it is followed by additional operators, these will be applied backwards to the reversed sequence.
The following code will return a list of all customers, in the opposite order of the original collection:
var list := from c in MyCustomers reverse;
The following (contrived) example code will first truncate the sequence the first 10 customers, reverse it and then take the first 5, in essence returning customer 10 through customer 6:
var list := from c in MyCustomers take 10 reverse take 5;
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To