Skip to content

Commit

Permalink
Add method Any.snitch in 6.e
Browse files Browse the repository at this point in the history
This allows one to easily inspect a stage of a method call chain
on STDERR:

    $ raku -e 'use v6.*; (^10).grep(* %% 2).snitch.map(* ** 2).say'
    (0 2 4 6 8)
    (0 4 16 36 64)
  • Loading branch information
lizmat committed Aug 17, 2022
1 parent 6c948e0 commit c89cd7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core.e/Any-iterable-methods.pm6
Expand Up @@ -16,6 +16,8 @@ augment class Any {
multi method skip(*@skips) {
self.skip(@skips)
}

method snitch() { note self; self }
}

proto sub rotor(|) {*}
Expand Down

0 comments on commit c89cd7b

Please sign in to comment.