Re: ^methods doesn't show all methods

2021-02-16 Thread Vadim Belman
It's not about gist truncating long lists. After all, when it does so it ends 
the output with triple dot.

Yet nobody spotted that not every methods in the list are represented by their 
names. Alongside with something like 'elems' there are many 
'Method+{is-nodal}.new' entries. This is due to `is nodal` trait mixin a role 
into a method object. Why this breaks Routine's gist method I'm not ready to 
answer.

The correct output is produced when we explicitly ask for code object name, 
i.e. when method .name is used one way or another. One can try this to see the 
difference:

say Set.^methods.map: *.gist
say Set.^methods.map: *.name

Best regards,
Vadim Belman

> On Feb 16, 2021, at 3:38 PM, Gianni Ceccarelli  wrote:
> 
> On 2021-02-16 Joseph Brenner  wrote:
>> But I don't see them in the list from .^methods:
>> 
>>  say $s.^methods;
>> 
>>  say so $s.^methods.gist.grep(/<>/); # False
> 
> ``say`` calls ``.gist``, which produces a *truncated* string
> representation for long lists::
> 
>$ raku -e 'say (^1000).List'
>(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 
> 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 
> 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 
> 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...)
> 
> If you grep the list itself, instead of its gist::
> 
>$ raku -e 'Set.^methods.map(*.name).grep(/keys/)>>.say'
>keys
> 
> -- 
>   Dakkar - 
>   GPG public key fingerprint = A071 E618 DD2C 5901 9574
>6FE2 40EA 9883 7519 3F88
>   key id = 0x75193F88
> 



Re: ^methods doesn't show all methods

2021-02-16 Thread Joseph Brenner
Gianni Ceccarelli  wrote:

>If you grep the list itself, instead of its gist::
>
> $ raku -e 'Set.^methods.map(*.name).grep(/keys/)>>.say'
> keys

Yes, you're right.  That's all there was to it.


Re: ^methods doesn't show all methods

2021-02-16 Thread Gianni Ceccarelli
On 2021-02-16 Joseph Brenner  wrote:
> But I don't see them in the list from .^methods:
> 
>   say $s.^methods;
>
>   say so $s.^methods.gist.grep(/<>/); # False

``say`` calls ``.gist``, which produces a *truncated* string
representation for long lists::

$ raku -e 'say (^1000).List'
(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...)

If you grep the list itself, instead of its gist::

$ raku -e 'Set.^methods.map(*.name).grep(/keys/)>>.say'
keys

-- 
Dakkar - 
GPG public key fingerprint = A071 E618 DD2C 5901 9574
 6FE2 40EA 9883 7519 3F88
key id = 0x75193F88



Re: ^methods doesn't show all methods

2021-02-16 Thread David Warring
I'm getting this on Rakudo blead.

$ raku -v
Welcome to Rakudo(tm) v2020.12-129-g291cc5f39.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2020.12-100-gc93531608.
$ raku -e'my $s = set 2, 4, 6; say $s.^methods>>.name.sort;'
(ACCEPTS ASSIGN-KEY AT-KEY BUILDALL Bag BagHash Baggy Bool Capture
DELETE-KEY EXISTS-KEY Hash Int Map Mix MixHash Mixy Num Numeric Real STORE
Set SetHash Setty Str WHICH antipairs default elems fmt gist grab grabpairs
hash item iterator keyof keys kv list maxpairs minpairs new new-from-pairs
of pairs pick pickpairs raku roll total values)

Which does seem to include associative methods
- David

On Wed, Feb 17, 2021 at 8:25 AM Joseph Brenner  wrote:

> Set objects have Associative methods:
>
>   my $s = set 2, 4, 6;
>   say $s.keys;   # (4 2 6)
>
> But I don't see them in the list from .^methods:
>
>   say $s.^methods;
>   # (menu default pick minpairs Setty grabpairs SET-SELF raku
> Method+{is-nodal}.new Real Baggy iterator keyof Method+{is-nodal}.new
> Method+{is-nodal}.new Method+{is-nodal}.new Mixy of grab
> Method+{is-nodal}.new ACCEPTS new elems Method+{is-nodal}.new Str
> Method+{is-nodal}.new WHICH Bool RAW-HASH fmt new-from-pairs Numeric
> total maxpairs Method+{is-nodal}.new Capture Method+{is-nodal}.new
> Method+{is-nodal}.new Method+{is-nodal}.new Int gist
> Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new
> Method+{is-nodal}.new Num Method+{is-nodal}.new Method+{is-nodal}.new
> Method+{is-nodal}.new roll pickpairs STORE BUILDALL)
>
>   say so $s.^methods.gist.grep(/<>/); # False
>
> I'm using the latest rakudo star release: v2020.10.
>
> Has this been fixed in later versions of Raku?
>


^methods doesn't show all methods

2021-02-16 Thread Joseph Brenner
Set objects have Associative methods:

  my $s = set 2, 4, 6;
  say $s.keys;   # (4 2 6)

But I don't see them in the list from .^methods:

  say $s.^methods;
  # (menu default pick minpairs Setty grabpairs SET-SELF raku
Method+{is-nodal}.new Real Baggy iterator keyof Method+{is-nodal}.new
Method+{is-nodal}.new Method+{is-nodal}.new Mixy of grab
Method+{is-nodal}.new ACCEPTS new elems Method+{is-nodal}.new Str
Method+{is-nodal}.new WHICH Bool RAW-HASH fmt new-from-pairs Numeric
total maxpairs Method+{is-nodal}.new Capture Method+{is-nodal}.new
Method+{is-nodal}.new Method+{is-nodal}.new Int gist
Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new
Method+{is-nodal}.new Num Method+{is-nodal}.new Method+{is-nodal}.new
Method+{is-nodal}.new roll pickpairs STORE BUILDALL)

  say so $s.^methods.gist.grep(/<>/); # False

I'm using the latest rakudo star release: v2020.10.

Has this been fixed in later versions of Raku?


Re: My OOP keeper

2021-02-16 Thread Ralph Mellor
With apologies to the list to the degree this is just noise.

I originally intended to send this email off list. But I realized
that what was confusing Todd might perhaps be confusing to
all of you. So I've decided to write this on list. *After* this one
I plan to go off list and email Todd privately unless this email
clears things up.



I'm not trying to demonstrate anything. I'm just trying to
be useful.

I hoped that your answer to my 4 questions was 4 x Yes.
That would clear the way for me to elaborate as you asked.

Or, Yes to some of my questions, and no to others.
That would guide me to elaborate on what you said No to.

I'm just trying to focus attention on what's useful. If our
exchange isn't useful to you, please feel free to not reply;
or reply on or off list and ask for us to end our exchange;
or let me know your answer to my questions; or try to
figure out and share with me what is confusing you; or
find some other way for us to continue in a way that would
be useful to you. Thanks.

--
love, ralph

On Tue, Feb 16, 2021 at 4:12 AM ToddAndMargo via perl6-users
 wrote:
>
> On 2/15/21 6:00 PM, Ralph Mellor wrote:
> >> Hope spring eternal.
> >
> > Indeed.
> >
> > First, let's get prototype-based OOP off the agenda. Both you
> > and Joseph appear to have focused on that one small part of
> > what I wrote. I think that focus isn't helpful. So I'm not going to
> > discuss prototype-based OOP further.
> >
> > 
> >
> > The only other thing I'll do in this email is ask four questions.
> >
> > Which of the following would you say you know, more or less?
> >
> > * What inheritance is;
> >
> > * Classes default to using inheritance to resolve which version
> > of a method gets used in response to a method call;
> >
> > * Inheritance is a significant source of bugs in OOP code;
> >
> > * Raku provides devs great OOP alternatives to inheritance
> > for resolving which version of a method gets used in response
> > to a method call.
> >
> > --
> > love, ralph
> >
>
>
> Hi Ralph,
>
> I am completely confused.  I have no idea what you
> are trying to demonstrate.
>
> :'(
>
> -T


Re: Tip: upgrading Rakudo-star

2021-02-16 Thread ToddAndMargo via perl6-users

On 2/16/21 2:39 AM, ToddAndMargo via perl6-users wrote:

Hi All,

I have been tasked by a customer to upgrade Rakudo Start (and others 
things too) on seven identical computers with Windows 10-20H2

on them.

Three of them are giving me that obnoxious Windows
uninstaller error telling me it can't find its temp
files.

To get around this, dig Rakudo out of two registry locations

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

and

HKUSERS\S-1-5-21-2073374597-1341776624-1878667131-1002\SOFTWARE\Microsoft\Installer\Products 



Then manually delete the C:\rakudo directory.

Now you can upgrade.

-T



If you want to use this tip on other programs, you
also have to look in

HKLM\Software\Classes\Installer\Products


Tip: upgrading Rakudo-star

2021-02-16 Thread ToddAndMargo via perl6-users

Hi All,

I have been tasked by a customer to upgrade Rakudo Start (and others 
things too) on seven identical computers with Windows 10-20H2

on them.

Three of them are giving me that obnoxious Windows
uninstaller error telling me it can't find its temp
files.

To get around this, dig Rakudo out of two registry locations

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

and

HKUSERS\S-1-5-21-2073374597-1341776624-1878667131-1002\SOFTWARE\Microsoft\Installer\Products

Then manually delete the C:\rakudo directory.

Now you can upgrade.

-T