sink
ErrorsCollection

sink

Synthesised documentation from type/HyperSeq type/RaceSeq type/Seq type/Proc type/List

From type/HyperSeq

See Original text in context

method sink(--> Nil)

Sinks the underlying data structure, producing any side effects.

From type/RaceSeq

See Original text in context

method sink(--> Nil)

Sinks the underlying data structure, producing any side effects.

From type/Seq

See Original text in context

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.

From type/Proc

See Original text in context

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 directory 
# The spawned command 'ls /qqq' exited unsuccessfully (exit code: 2) 
#   in block <unit> at /tmp/3169qXElwq line 1 
# 

From type/List

See Original text in context

method sink(--> Nil{ }

It does nothing, and returns Nil, as the definition clearly shows.

sink [1,2,Failure.new("boo!"),"still here"]; # OUTPUT: «»