Vadim Belman <vr...@lflat.org> wrote:

> 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

Okay, I thought this over a bit and decided to open an issue for it:

  https://github.com/rakudo/rakudo/issues/4207

I don't think the "^methods" feature should require knowledge of this
".name" method-- it's something a beginner is likely to be playing
with, e.g. it's mentioned on p.3 of brian d foy's "Learning Perl6".

And if it's not practical to fix the behavior of .gist on Method
objects, then this idiom should be featured in the documentation
somewhere.  There's nothing like .^methods.map(*.name).say shown here,
for example:

  https://docs.raku.org/routine/methods

Reply via email to