method sink
1 | class List |
1.1 | (List) method sink |
2 | class HyperSeq |
2.1 | (HyperSeq) method sink |
3 | class RaceSeq |
3.1 | (RaceSeq) method sink |
4 | class Proc |
4.1 | (Proc) method sink |
5 | class Seq |
5.1 | (Seq) method sink |
Documentation for method sink
assembled from the following types:
class List
From List
(List) method sink
Defined as:
method sink(--> Nil)
It does nothing, and returns Nil
, as the definition clearly shows.
sink [1,2,Failure.new("boo!"),"still here"]; # OUTPUT: «»
class HyperSeq
From HyperSeq
(HyperSeq) method sink
Defined as:
method sink(--> Nil)
Sinks the underlying data structure, producing any side effects.
class RaceSeq
From RaceSeq
(RaceSeq) method sink
Defined as:
method sink(--> Nil)
Sinks the underlying data structure, producing any side effects.
class Proc
From Proc
(Proc) method sink
Defined as:
method sink(--> Nil)
When sunk, the Proc
object will throw X::Proc::Unsuccessful if the process it ran exited unsuccessfully.
shell 'ls /qqq';# OUTPUT: «(exit code 1) ls: cannot access '/qqq': No such file or directoryThe spawned command 'ls /qqq' exited unsuccessfully (exit code: 2)n block <unit> at /tmp/3169qXElwq line 1»
class Seq
From Seq
(Seq) method sink
Defined as:
method sink(--> Nil)
Calls sink-all
if it is an Iterator
, sink
if the Sequence is a list.
say (1 ... 1000).sink; # OUTPUT: «Nil»
This is something you might want to do for the side effects of producing those values.