Re: getting help in the REPL
timo@schmetterling ~> perl6 -e '#| this is sub foo documentation sub foo() { }; say say ' this is sub foo documentation No such method 'WHEREFOR' for invocant of type 'Pod::Block::Declarator'. Did you mean 'WHEREFORE'? in block at -e line 4 timo@schmetterling ~ [1]> perl6 -e '#| this is sub foo documentation sub foo() { }; say say ' this is sub foo documentation sub foo () { #`(Sub|49720168) ... } WHEREFOR is the opposite of WHY, it gives you back what the object is that a piece of declaration describes. HTH - Timo
Re: getting help in the REPL
$ perl6 To exit type 'exit' or '^D' > #|{ because } class Foo { } (Foo) > Foo.WHY because > On Wednesday, June 14, Gabor Szabo wrote: > Thanks for all the responses so far. > > On Wed, Jun 14, 2017 at 4:44 PM, Timo Paulssenwrote: > > WHY and WHEREFOR are "fully" supported, it's just that we've not put any > > pod into the core setting and we don't have helper code that loads it > > "lazily" when WHY is called the first time on a core class or sub … > > $ perl6 > To exit type 'exit' or '^D' > > my @x = 1, 2, 3; > [1 2 3] > > @x.WHY > (Any) > > @x.WHEREFOR > No such method 'WHEREFOR' for invocant of type 'Array' > in block at line 1 > > $ perl6 -v > This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda > implementing Perl 6.c. > > > In additionally, can I list all the built-in variables, functions, and > objects? While inside the REPL.. > > > regards > Gabor
Re: getting help in the REPL
Thanks for all the responses so far. On Wed, Jun 14, 2017 at 4:44 PM, Timo Paulssenwrote: > WHY and WHEREFOR are "fully" supported, it's just that we've not put any > pod into the core setting and we don't have helper code that loads it > "lazily" when WHY is called the first time on a core class or sub … $ perl6 To exit type 'exit' or '^D' > my @x = 1, 2, 3; [1 2 3] > @x.WHY (Any) > @x.WHEREFOR No such method 'WHEREFOR' for invocant of type 'Array' in block at line 1 $ perl6 -v This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda implementing Perl 6.c. In additionally, can I list all the built-in variables, functions, and objects? While inside the REPL.. regards Gabor
Re: getting help in the REPL
WHY and WHEREFOR are "fully" supported, it's just that we've not put any pod into the core setting and we don't have helper code that loads it "lazily" when WHY is called the first time on a core class or sub …
Re: getting help in the REPL
On Wed, Jun 14, 2017 at 04:00:05PM +0300, Gabor Szabo wrote: > In the python interactive shell one can write dir(object) and it > lists the attributes and methods of the object. One can write > help(object) and get the documentation of the object. > Is there anything similar in Perl 6? I think the original intent was for .WHY to work in this manner -- it's intended to provide the attached Pod value. I don't know to what level Rakudo implements this yet. There's an example given at https://docs.perl6.org/routine/WHY . Pm
Re: getting help in the REPL
On Wednesday, June 14, Gabor Szabo wrote: > Hi, > > In the python interactive shell one can write dir(object) and it > lists the attributes and methods of the object. One can write > help(object) and get the documentation of the object. > > Is there anything similar in Perl 6? object.^methods, object.^attributes and object.WHY? Brian
getting help in the REPL
Hi, In the python interactive shell one can write dir(object) and it lists the attributes and methods of the object. One can write help(object) and get the documentation of the object. Is there anything similar in Perl 6? Gabor