class Array

Public Instance Methods

adsl_indent() click to toggle source
# File lib/adsl/util/general.rb, line 50
def adsl_indent
  join("").adsl_indent
end
optimize() click to toggle source
# File lib/adsl/parser/ast_nodes.rb, line 9
def optimize
  map do |e|
    e.respond_to?(:optimize) ? e.optimize : e
  end
end
select_reject() { |e| ... } click to toggle source
# File lib/adsl/util/general.rb, line 54
def select_reject
  arr1 = []
  arr2 = []
  self.each do |e|
    if yield e
      arr1 << e
    else
      arr2 << e
    end
  end
  return arr1, arr2
end
set_to(array) click to toggle source
# File lib/adsl/util/general.rb, line 67
def set_to(array)
  self.clear
  array.each{ |e| self << e }
  self
end
worklist_each() { |task| ... } click to toggle source
# File lib/adsl/util/general.rb, line 37
def worklist_each
  changed = true
  until empty? or not changed
    changed = false
    length.times do
      task = self.shift
      new_value = yield task
      self << new_value if new_value
      changed = true if task != new_value
    end
  end
end