Re: [perl #131583] [BUG] Sort content of ^methods
On Fri, Jun 16, 2017 at 12:41 AM, Gabor Szabowrote: > 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 allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
Re: [perl #131583] [BUG] Sort content of ^methods
On Fri, Jun 16, 2017 at 12:41 AM, Gabor Szabowrote: > 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 allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
Re: [perl #131583] [BUG] Sort content of ^methods
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 RTwrote: > 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 > wrote: > >> # New Ticket Created by Gabor Szabo >> # Please include the string: [perl #131583] >> # in the subject line of all future correspondence about this issue. >> # 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. >> >
Re: [perl #131583] [BUG] Sort content of ^methods
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 RTwrote: > 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 > wrote: > >> # New Ticket Created by Gabor Szabo >> # Please include the string: [perl #131583] >> # in the subject line of all future correspondence about this issue. >> # 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. >> >
Re: [perl #131583] [BUG] Sort content of ^methods
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 Szabowrote: > # New Ticket Created by Gabor Szabo > # Please include the string: [perl #131583] > # in the subject line of all future correspondence about this issue. > # 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. >
Re: [perl #131583] [BUG] Sort content of ^methods
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 Szabowrote: > # New Ticket Created by Gabor Szabo > # Please include the string: [perl #131583] > # in the subject line of all future correspondence about this issue. > # 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. >