rringler (Ryan Ringler)
- Login: rringler
- Registered on: 09/24/2016
- Last sign in: 09/15/2018
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 2 | 1 | 3 |
Activity
05/27/2018
-
08:07 PM Ruby Feature #14788 (Open): `Hash#keys` Could Accept a Block
- Sometimes I only need to fetch *some* of the keys from a Hash. With the current `Hash#keys` implementation, this requires fetching all the keys and then selecting the ones I'm interested in. It would be nice if `Has#keys` accepted a bloc...
03/08/2018
-
04:42 AM Ruby Feature #14546: Hash#delete!
- sawa (Tsuyoshi Sawada) wrote:
> What is wrong with using `fetch`?
> ...
Hash#fetch is not mutative. This proposal is for a whiny version of #delete.
```ruby
hsh = { a: 'a' }; hsh.delete!(:a); hsh # => {}
hsh = { a: 'a' }; hsh.dele...
02/24/2018
-
04:42 AM Ruby Feature #14546: Hash#delete!
- nobu (Nobuyoshi Nakada) wrote:
> `Hash#delete` is destructive, so appending `!` doesn't seem making sense.
I'm as guilty of it as anyone, but as I understand [`!` does not mean destructive](https://www.ruby-forum.com/topic/176830#773...
02/23/2018
-
06:52 PM Ruby Feature #14546 (Assigned): Hash#delete!
- Hash#delete currently returns nil if a given key is not found in the hash. It would be nice to have a way to check that the key was present in the hash. This can be accomplished with with a block, but it would be nice to have some sugar ...
11/29/2016
-
03:42 AM Ruby Feature #12786: String#casecmp?
- Thank you for incorporating this!
I see the changeset implements the new method by calling `String#downcase` on both strings and compares the results for equality. While this does allow unicode support in advance of `String#casecmp`,...
11/27/2016
-
04:02 AM Ruby Feature #12786: String#casecmp?
- Nobuyoshi Nakada wrote:
> `String#casecmp` also should have those options, I think.
I agree, and feel strongly that the logic to support those options should live there. Someone smarter than I should probably make the changes Martin...
11/26/2016
-
09:13 PM Ruby Feature #12786: String#casecmp?
- Martin Dürst wrote:
> I gave an implementation in Ruby, but can somebody provide an equivalent patch in C?
The attached patch implements `#casecmp?` by calling `#casecmp` and checking whether the return value is zero. I think this p... -
09:09 PM Ruby Feature #12786: String#casecmp?
- Yukihiro Matsumoto wrote:
> `casecmp?` accepted.
> ...
Thank you!
09/24/2016
-
08:35 AM Ruby Feature #12786: String#casecmp?
- Some thoughts on method naming...
* New method: `#casecmp?`
* **PROS:** Nice symmetry with `Fixnum`'s `#<=>` & `#equal?` methods. 'casecmp' seems to imply case-insensitivity (see `String#casecmp` or C's `strcasecmp`)
* **CONS:**... -
03:02 AM Ruby Feature #12786: String#casecmp?
- Martin Dürst wrote:
> Does it only compare for equality (after case folding)?
Yep. All it would do is check if the return value of `#casecmp` is equal to zero. I'm sure there are plenty of clever uses for `#casecmp`, but I've only ...