Documentation for routine eager

Documentation for routine eager, assembled from the following types:

class Any

From Any

(Any) method eager

Defined as:

method eager(--> Seq:Dis nodal

Interprets the invocant as a list, evaluates it eagerly, and returns that list.

say (1..10).eager;              # OUTPUT: «(1 2 3 4 5 6 7 8 9 10)␤» 

class List

From List

(List) routine eager

Defined as:

multi method eager(List:D: --> List:D)
multi sub eager(*@elems --> List:D)

Evaluates all elements in the list eagerly, and returns them as a list.

say (1,2,3,4,5).eager# OUTPUT: «(1 2 3 4 5)␤» 

class Seq

From Seq

(Seq) method eager

method eager(Seq:D: --> List:D)

Returns an eagerly evaluated List based on the invocant sequence, and marks it as consumed. If called on an already consumed sequence, throws an error of type X::Seq::Consumed.