parrotcode:
methods for the Range class
Contents
|
Language Implementations
|
Perl6
NAME
src/classes/Range.pir - methods for the Range class
DESCRIPTION
Methods
VTABLE_get integer (vtable method)
VTABLE_get_number (vtable method)
VTABLE_get_string (vtable method)
ACCEPTS(topic)
Determines if topic is within the range or equal to the range.
clone() (vtable method)
Create a clone of the Range.
from()
to()
Gets the beginning or end of the range.
iterator() (vtable method)
Return an iterator for the Range. Since Ranges are already iterators, we can just return a clone.
list()
Generate the Range in list context. Currently we generate all of the elements in the range; when we have lazy lists we can just return a clone of the Range.
min()
minmax()
max()
pop() (vtable_method)
Generate the next element at the end of the Range.
shift() (vtable_method)
Generate the next element at the front of the Range.
true()
Return true if there are any more values to iterate over.
perl()
Returns a Perl representation of the Range.
Operators
infix:<..>
infix:<^..>
infix:<..^>
infix:<^..^>
Construct a range from the endpoints.
prefix:<^>(Any $to)
Construct a Range from
0 ..^ $to
.
prefix:<^>(Type $x)
Return $x.HOW.
prefix:<^>(List @a)
Private methods
!from_test(topic)
!to_test(topic)
Returns true if
topic
is greater than
.from
/ less than
.to
, honoring exclusive flags.