Skip to content

Sourceable

Aleks-Daniel Jakimenko-Aleksejev edited this page Dec 5, 2019 · 1 revision

This is an IRC bot for finding sub/method/code definitions in Rakudo's source code. It can be addressed by its full name ('sourcable6') or using the shortcut ('s:'). In most cases it will figure out automatically what you're looking for. It defaults to using HEAD but you can use it for almost any rakudo commit that is not too old.

You can find some extra examples in tests: sourceable.t

Usage examples

Basics

<AlexDaniel> s: copy
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/io_operators.pm6#L234

<AlexDaniel> s: sprintf('<%#B>', 12)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Cool.pm6#L467

<AlexDaniel> s: 42.is-prime
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Int.pm6#L150

<AlexDaniel> s: 'abcd'.match(/./, :1x)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Str.pm6#L1089

<AlexDaniel> s: 1 < 3
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Int.pm6#L447

<AlexDaniel> s: Num.new(my num $ = 2e0)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Num.pm6#L35

<AlexDaniel> s: await(Channel.new)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.d/await.pm6#L18

<AlexDaniel> s: &prefix:<+>(^10)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Numeric.pm6#L59

Running on revisions other than HEAD

Just start your message with a commit:

<AlexDaniel> s: c95c4a7 sprintf('<%#B>', 12)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/c95c4a7/src/core/Cool.pm#L291

Proto vs Actual method

There is a difference between running a method with parens and without. Without parens, you will get the location of the proto if it's a multi method. Note that a proto can be in a different file, so both behaviors are useful.

<AlexDaniel> s: NaN.FatRat.Bool
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Mu.pm6#L101

<AlexDaniel> s: NaN.FatRat.Bool()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Rational.pm6#L106

More examples

<AlexDaniel> s: EVAL
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/ForeignCode.pm6#L27

<AlexDaniel> s: &infix:['+<']
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Numeric.pm6#L349

<AlexDaniel> s: &postfix:<⚛++>(my atomicint $x)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/atomicops.pm6#L81

<AlexDaniel> s: &infix:<eqv>(do { my %h = a => Mu; \($%h, $%h)})
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Mu.pm6#L962

<AlexDaniel> s: &say.assuming
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Code.pm6#L50

<AlexDaniel> s: permutations((1,))
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L1623

<AlexDaniel> s: (1,).permutations()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L1244

<AlexDaniel> s: X::Str::Numeric.message
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Exception.pm6#L2059

<AlexDaniel> s: Perl.version
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Perl.pm6#L19

<AlexDaniel> s: 0e0.Rat
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Num.pm6#L46

<AlexDaniel> s: $*KERNEL.release
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Kernel.pm6#L84

<AlexDaniel> s: &infix:<cmp>(Nil, Nil)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Order.pm6#L10

<AlexDaniel> s: Nil cmp Nil
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Order.pm6#L10

<AlexDaniel> s: <2.2>.succ
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/allomorphs.pm6#L82

<AlexDaniel> s: &postfix:<++>(my $ = <2.2>)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any.pm6#L518

<AlexDaniel> s: ((1..1000).List).gist
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Mu.pm6#L602

<AlexDaniel> s: ((1..1000).List).gist()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L838

<AlexDaniel> s: [1..1000].gist
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Mu.pm6#L602

<AlexDaniel> s: [1..1000].gist()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L838

<AlexDaniel> s: &[orelse]
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/operators.pm6#L730

<AlexDaniel> s: ().Seq.batch(42)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L2079

<AlexDaniel> s: ().to()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L379

<AlexDaniel> s: &WHENEVER
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Supply.pm6#L2275

<AlexDaniel> s: ^4 .hyper.item()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Iterable.pm6#L16

<AlexDaniel> s: Promise.at(now)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Promise.pm6#L278

<AlexDaniel> s: ((*.so)).Bool()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Mu.pm6#L103

<AlexDaniel> s: [].List
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any.pm6#L69

<AlexDaniel> s: [].List()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Array.pm6#L422

<AlexDaniel> s: rand ⊇ rand
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/set_subset.pm6#L181

<AlexDaniel> s: Kept === Broken
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Enumeration.pm6#L125

<AlexDaniel> s: (^4).min
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Range.pm6#L4

<AlexDaniel> s: [].Str()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L376

<AlexDaniel> s: [].join()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L1250

<AlexDaniel> s: /^/.ACCEPTS(any("opensuse", "linux"))
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Code.pm6#L7

<AlexDaniel> s: &infix:<eqv>(%(:42a), %(:42a))
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Map.pm6#L651

<AlexDaniel> s: %(:42a) eqv %(:42a)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Map.pm6#L651

<AlexDaniel> s: &infix:<,>()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L1556

<AlexDaniel> s: IO::Handle.close
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/IO/Handle.pm6#L222

<AlexDaniel> s: &infix:«<»((my int $), (my int $))
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Int.pm6#L450

<AlexDaniel> s: (my int $) < (my int $)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Int.pm6#L450

<AlexDaniel> s: &[Z](<x>.any, <x>.any)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/List.pm6#L1739

<AlexDaniel> s: Seq.new(class :: does Iterator { has $!n = 10; method pull-one {say "pulling!"; $!n-- and 42 or IterationEnd }; method skip-one { $!n-- }; method count-only { 10 } }.new).tail()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L1954

<AlexDaniel> s: &infix:<!=>(4 & 6, 42)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Numeric.pm6#L308

<AlexDaniel> s: 4 & 6 != 42
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Numeric.pm6#L308

<AlexDaniel> s: [].unique(:with(-> $a, $, { dd $a }))
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L1652

<AlexDaniel> s: (1, 2, 3).unique
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L1559

<AlexDaniel> s: (1, 2, 3).unique()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L1600

<AlexDaniel> s: &trait_mod:<is>(sub {}, :equiv)
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/traits.pm6#L133

<AlexDaniel> s: CORE::.keys.grep(* ne "IterationEnd").map({CORE::{$_}}).grep({ !.DEFINITE and try .can("say") }).unique()
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Any-iterable-methods.pm6#L1600

<AlexDaniel> s: (my %b = :1a).ACCEPTS(my %a = :1a)
<sourceable6> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Map.pm6#L165

<AlexDaniel> s: ''.subst(:g, '', '')
<sourceable> AlexDaniel, https://github.com/rakudo/rakudo/blob/f3dda96/src/core.c/Str.pm6#L1182