Make Set a builtin feature [Feature #16989]

This commit is contained in:
Akinori MUSHA 2022-02-17 18:02:42 +09:00
parent 7757ccb504
commit dd3501bb95
Notes: git 2022-02-18 11:56:45 +09:00
3 changed files with 49 additions and 1 deletions

View file

@ -20,3 +20,12 @@ module Kernel
private :pp
end
autoload :Set, 'set'
module Enumerable
# Makes a set from the enumerable object with given arguments.
def to_set(klass = Set, *args, &block)
klass.new(self, *args, &block)
end
end