A set is an unordered collection of objects that contains no duplicates.

Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
kind = "Set"
Active cells (details)
+(otherSet)

returns a new set that contains the receivers elements and the elements of the set sent in as the argument.

<<(value)

Adds the argument to this set, if it's not already in the set. Returns the set after adding the object.

==(other)

returns true if the left hand side set is equal to the right hand side set.

===(other)

nil

method(other, 
  if(self same?(
      []), 
    Reflector other:mimics?(cell(:other), 
      []), 
    bind(rescue(Condition Error, fn(c, false)), 
      self include?(
        other))))
?&(...)

if this set is non-empty, returns the result of evaluating the argument, otherwise returns the set

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      1), 
    
    theCode = call arguments [](
        0) 
    
    unless(empty?, 
      call argAt(0), 
      self), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
?|(...)

if this set is empty, returns the result of evaluating the argument, otherwise returns the set

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      1), 
    
    theCode = call arguments [](
        0) 
    
    if(empty?, 
      call argAt(0), 
      self), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
each([indexOrArgOrCode] nil, [argOrCode] nil, [code] nil)

takes either one, two or three arguments. if one argument is given, it should be a message chain that will be sent to each object in the set. the result will be thrown away. if two arguments are given, the first is an unevaluated name that will be set to each of the values in the set in succession, and then the second argument will be evaluated in a scope with that argument in it. if three arguments is given, the first one is an unevaluated name that will be set to the index of each element, and the other two arguments are the name of the argument for the value, and the actual code. the code will evaluate in a lexical context, and if the argument name is available outside the context, it will be shadowed. the method will return the set. the iteration order is not defined.

empty?()

returns true if this set is empty, false otherwise

hash()

returns a hash for the set

ifEmpty(...)

if this set is empty, returns the result of evaluating the argument, otherwise returns the set

macro(
  argCount = call arguments length 
  cond(
    argCount ==(
      1), 
    
    theCode = call arguments [](
        0) 
    
    if(empty?, 
      call argAt(0), 
      self), 
    error!(Condition Error Invocation NoMatch, message: call message, context: call currentContext)) 
  )
include?(object)

returns true if the receiver includes the evaluated argument, otherwise false

inspect()

Returns a text inspection of the object

notice()

Returns a brief text inspection of the object

remove!(value)

Removes the argument from the set, if it's in the set. Returns the set after removing the object.

seq()

returns a new sequence to iterate over this set

withIdentitySemantics!()

Converts this set to use identity semantics, and then returns it.

(element)

returns true if the argument is in the set

method(element, 
  include?(element))
(element)

returns false if the argument is in the set

method(element, 
  !(include?(element)))
(otherSet)

returns a new set that is the intersection of the receiver and the argument.

(other)

returns a new set that is the set-theoretic union of this set and the argument set

method(other, 
  self +(other))
(otherSet)

returns true if this set is a proper subset of the argument set

(otherSet)

returns true if this set is a proper superset of the argument set

(otherSet)

returns true if this set is a subset of the argument set

(otherSet)

returns true if this set is a superset of the argument set