Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort content of ^methods #6346

Open
p6rt opened this issue Jun 16, 2017 · 5 comments
Open

Sort content of ^methods #6346

p6rt opened this issue Jun 16, 2017 · 5 comments
Labels
RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented Jun 16, 2017

Migrated from rt.perl.org#131583 (status was 'open')

Searchable as RT131583$

@p6rt
Copy link
Author

p6rt commented Jun 16, 2017

From @szabgab

I think it would be better to have the list returned by ^methods
sorted in abc order.

@p6rt
Copy link
Author

p6rt commented Jun 16, 2017

From @LLFourn

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-archive.perl.org/perl6/Ticket/Display.html?id=131583 >

I think it would be better to have the list returned by ^methods
sorted in abc order.

@p6rt
Copy link
Author

p6rt commented Jun 16, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 16, 2017

From @szabgab

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​:

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-archive.perl.org/perl6/Ticket/Display.html?id=131583 >

I think it would be better to have the list returned by ^methods
sorted in abc order.

@p6rt
Copy link
Author

p6rt commented Jun 16, 2017

From @geekosaur

On Fri, Jun 16, 2017 at 12​:41 AM, Gabor Szabo <szabgab@​gmail.com> wrote​:

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

@p6rt p6rt added the RFC Request For Comments label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

1 participant