crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Add `Set#select!`, `Set#reject!`, and `Set#map!`

Open potomak opened this issue 3 years ago • 1 comments

I'm also adding:

  • Set#keep_if, used in the implementation of Set#select!
  • Set#delete_if, used in the implementation of Set#reject!
  • Set#filter!, an alias for #select!

Closes #9976

potomak avatar Jul 17 '22 18:07 potomak

Please don't add the method name aliases. The Crystal standard library no longer features them.

The methods #select! and #reject! never return nil in Crystal. You could see this being the case in Array and Hash.

HertzDevil avatar Jul 18 '22 02:07 HertzDevil