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
Why do Array / Hash not have .grab like QuantHashes do? #1658
Comments
|
Isn't It's not supported on MixHash either, due to fractional weights: So there's no lack of consistency in available methods. |
I would argue that weighting is merely a feature of So As for This, to me, is actually an argument in favour of
This issue arose when I was building a simple quicksort demonstration to a random pivot: which I expected to work...but which, to my chagrin, didn't.
|
|
Yeah, |
|
There is actually a bit of an issue wrt On So in that respect, we're looking at a compatibility / expectance issue. |
|
And then we have Supply.grab, which does something else entirely :-( |
|
Proof of concept of |
|
Well, it was intended as a proof-of-concept. And there's still the matter of the semantics of |
|
Ah, right.
I think everything still makes sense if you squint enough and detach yourself from knowledge that BagHash is implemented as a Hash, which can be seen as an implementation detail:
In other words, they're conceptually different: a So in this view, a A counter-argument is that iterating over a |
|
Proof of concept implementation of (native array).grab with a393ff6 |
|
The confusing thing in this is that we also have |
|
Awesome work on Hmmmm. It's probably too late to retcon it all now, but I'd much Specifically, it would be much easier and more consistent/predictable And then In which case, maybe the (in which case, perhaps they should also support Hmmmmm. |
|
To further confuse the matter: |
|
Also note that a |
|
Okay, so I completely misunderstood the purpose and semantics of Forget the adverb suggestion, which was not sensible, given what (Okay, maybe adverbs would still be useful on |
Seems like an easy enough thing to implement for consistency / user expectance
The text was updated successfully, but these errors were encountered: