Sidef::Types::Set::Set
This class implements ...
var a = Set(1,2,3,4) var b = Set(2,3,5) say (a ^ b) #=> Set(1, 4, 5) say (a - b) #=> Set(1, 4) say (a | b) #=> Set(1, 2, 3, 4, 5) say (a & b) #=> Set(2, 3) say a.has(2) #=> true say a.len #=> 4 say b.map {|n| n**2 } #=> Set(4, 9, 25) say b.grep {.is_odd} #=> Set(3, 5)
Inherits methods from:
* Sidef::Types::Hash::Hash
a & b
Returns the
Aliases: ∩, and, intersection
a + b
Aliases: concat
a - b
Aliases: ∖, sub, diff, difference
a ... b
Aliases: to_list
a << b
Aliases: add, push, append
a ^ b
Aliases: xor, symdiff, symmetric_difference
a | b
Aliases: ∪, or, union
a ∋ b
Aliases: has, exists, has_key, haskey, contain, include, contains, includes
a ∌ b
a ≡ b
a ≤ b
Aliases: ⊆, <=, is_subset
a ≥ b
Aliases: ⊇, >=, is_superset
self.all(block)
self.any(block)
self.collect(block)
self.contains_all(*objects)
self.count(obj)
self.count_by(block)
self.delete(*objects)
Aliases: remove, discard
self.delete_first_if(block)
self.delete_if(block)
self.dump
self.each(block)
self.each_2d(block)
self.grep(block)
Aliases: select
self.grep_2d(block)
self.iter
self.join(*rest)
self.map(block)
self.map_2d(block)
self.max
self.max_by(block)
self.min
self.min_by(block)
self.new
Aliases: call
self.none(block)
self.pop
self.prod(block)
Aliases: prod_by
self.prod_2d(block)
self.shift
self.sort(block)
self.sort_by(block)
self.sum(block)
Aliases: sum_by
self.sum_2d(block)
self.to_a
Aliases: values, to_array
self.to_bag
self.to_set
To install Sidef, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sidef
CPAN shell
perl -MCPAN -e shell install Sidef
For more information on module installation, please visit the detailed CPAN module installation guide.