kernel/delta/array.rb
# Helper to recurse through flattening since the method
# is not allowed to recurse itself. Detects recursive structures.
Helper to recurse through flattening since the method
is not allowed to recurse itself. Detects recursive structures.
Helper to recurse through flattening since the method is not allowed to recurse itself . Detects recursive structures .
def recursively_flatten(array, out, recursive_placeholder = Undefined)
    if RecursionGuard.inspecting?(array)
      if recursive_placeholder.equal? Undefined
        raise ArgumentError, "tried to flatten recursive array"
      else
        out << recursive_placeholder
        return nil
      end
    end
    ret = nil
    array.each { |o|
      if o.respond_to? :to_ary
        RecursionGuard.inspect(array) do
          ary = Type.coerce_to o, Array, :to_ary
          recursively_flatten(ary, out, recursive_placeholder)
          ret = self
        end
      else
        out << o
      end
    }
    ret
  end
def recursively_flatten ( array , out , recursive_placeholder = Undefined ) if RecursionGuard . inspecting? ( array ) if recursive_placeholder . equal? Undefined raise ArgumentError , "tried to flatten recursive array" else out << recursive_placeholder return nil end end ret = nil array . each { | o | if o . respond_to? :to_ary RecursionGuard . inspect ( array ) do ary = Type . coerce_to o , Array , :to_ary recursively_flatten ( ary , out , recursive_placeholder ) ret = self end else out << o end } ret end
Helper to recurse through flattening since the method
is not allowed to recurse itself.
Helper to recurse through flattening since the method is not allowed to recurse itself .
array
<not_specific>
out
<not_specific>
recursive_placeholder
<not_specific>