Documentation for routine tail

Documentation for routine tail, assembled from the following types:

class Any

From Any

(Any) method tail

Defined As:

    method tail(--> TODO)


class List

From List

(List) method tail

Defined as:

method tail(List:D: Int(Cool$number = 1 --> Seq:D)

Returns a Seq containing the last NUMBER items of the list. Returns an empty Seq if NUMBER <= 0. Defaults to the last element if no NUMBER is specified. Throws an exception if the list is lazy.


say ^10 .tail(5);      # OUTPUT: «(5 6 7 8 9)␤» 
say ^Inf .tail(5);     # Cannot tail a lazy list 
say ^10 .tail;         # OUTPUT: «(9)␤» 
say ^Inf .tail;        # Cannot tail a lazy list 

class Supply

From Supply

(Supply) method tail

method tail(Supply:D: Int(Cool$number = 1 --> Supply:D)

Creates a "tail" supply with the same semantics as List.tail.