Skip Menu |
Report information
Id: 131583
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: szabgab [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Gabor Szabo <szabgab [...] gmail.com>
Date: Fri, 16 Jun 2017 07:08:53 +0300
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
Subject: [BUG] Sort content of ^methods
I think it would be better to have the list returned by ^methods sorted in abc order.
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Fri, 16 Jun 2017 04:26:11 +0000
Subject: Re: [perl #131583] [BUG] Sort content of ^methods
To: perl6-compiler [...] perl.org, bugs-bitbucket [...] rt.perl.org
Download (untitled) / with headers
text/plain 635b

Str.^methods.sort(*.name)

Is easy enough once you know to do it :)
I don't think we should specify a particular order for the returned methods and alphabetic sorting is kinda arbitrary. Why not sorted by class inheritance for example?


On Fri, Jun 16, 2017 at 2:09 PM Gabor Szabo <perl6-bugs-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  Gabor Szabo
# Please include the string:  [perl #131583]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=131583 >


I think it would be better to have the list returned by ^methods
sorted in abc order.
Subject: Re: [perl #131583] [BUG] Sort content of ^methods
To: perl6-bugs-followup [...] perl.org
From: Gabor Szabo <szabgab [...] gmail.com>
Date: Fri, 16 Jun 2017 07:41:01 +0300
Download (untitled) / with headers
text/plain 1.1k
I think the question when would ^methods be used? Would it be used by people who use the REPL to experiment with the languages? In that case the listing should be as user friendly as possible and require as little typing as possible. Having ABC order is IMHO the easiest to look through. (e.g. in python it is dir(object) ) If there was some other, even easier way to get this list, that would be even better. On Fri, Jun 16, 2017 at 7:26 AM, Lloyd Fournier via RT <perl6-bugs-followup@perl.org> wrote: Show quoted text
> Str.^methods.sort(*.name) > > Is easy enough once you know to do it :) > I don't think we should specify a particular order for the returned methods > and alphabetic sorting is kinda arbitrary. Why not sorted by class > inheritance for example? > > On Fri, Jun 16, 2017 at 2:09 PM Gabor Szabo <perl6-bugs-followup@perl.org> > wrote: >
>> # New Ticket Created by Gabor Szabo >> # Please include the string: [perl #131583] >> # in the subject line of all future correspondence about this issue. >> # <URL: https://rt.perl.org/Ticket/Display.html?id=131583 > >> >> >> I think it would be better to have the list returned by ^methods >> sorted in abc order. >>
>
To: Gabor Szabo <szabgab [...] gmail.com>
Subject: Re: [perl #131583] [BUG] Sort content of ^methods
Date: Fri, 16 Jun 2017 00:47:19 -0400
From: Brandon Allbery <allbery.b [...] gmail.com>
CC: Carl Mäsak via RT <perl6-bugs-followup [...] perl.org>

On Fri, Jun 16, 2017 at 12:41 AM, Gabor Szabo <szabgab@gmail.com> wrote:
Show quoted text
Would it be used by people who use the REPL to experiment with the
languages? In that case the listing should be as user friendly as
possible and require as little typing as possible. Having ABC order is
IMHO the easiest to look through.

If we're going to provide that ability, it should probably not be done via the metaobject interface. Relying on that can get you surprises, in particular quite a few anonymous methods for various things with low level implementations (and other surprises if you dig deeper and it's implemented in nqp).

(dir() in python is a different issue, since as far as python is concerned it's just listing the keys in some dict, and sorting them would usually be desirable. That said dict happens to represent an object is irrelevant.)

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org