[perl6/specs] 9213b1: Spec .min/.max on Bags

2014-04-13 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 9213b1382078fee890ab9d74223f3c7e95942837
  
https://github.com/perl6/specs/commit/9213b1382078fee890ab9d74223f3c7e95942837
  Author: Elizabeth Mattijsen l...@dijkmat.nl
  Date:   2014-04-13 (Sun, 13 Apr 2014)

  Changed paths:
M S32-setting-library/Containers.pod

  Log Message:
  ---
  Spec .min/.max on Bags




[perl6/specs] 89cc32: Spec Bag.kxxv

2014-04-13 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 89cc32d82d4f8cd49040ee56d54e04dbc04b65bc
  
https://github.com/perl6/specs/commit/89cc32d82d4f8cd49040ee56d54e04dbc04b65bc
  Author: Elizabeth Mattijsen l...@dijkmat.nl
  Date:   2014-04-13 (Sun, 13 Apr 2014)

  Changed paths:
M S32-setting-library/Containers.pod

  Log Message:
  ---
  Spec Bag.kxxv




Re: [perl6/specs] 89cc32: Spec Bag.kxxv

2014-04-13 Thread Damian Conway
   Spec Bag.kxxv

It's a clever name...but maybe too clever?

I find it unfortunate that a method that only returns keys has a 'v'
in its name.
Up to now, we've had a more predictable pattern to naming these accessors.

How about one of:

 .weighted-keys
 .distribution

instead???

And what is the use-case for this?
I can see that I might want:

$bag.kxxv.pick;

but:

$bag.pick

already does that.

I guess you might want to separate out the steps for some reason:

my $selection = median_value_from( $bag.kxxv );

but that would be far more readable/maintainable as:

my $selection = median_value_from( $bag.distribution );


Damian