class Lambda

Public Class Methods

array(it) click to toggle source
# File lib/lib/lambda.rb, line 6
def Lambda.array(it)
  a = Array.new
  _it = Rb::RubyIterator.new(it)
  while(_it.has_next) do
    i = _it._next
    a.push(i)
  end
  a
end
has(it,elt) click to toggle source
# File lib/lib/lambda.rb, line 26
def Lambda.has(it,elt)
  _it = Rb::RubyIterator.new(it)
  while(_it.has_next) do
    x = _it._next
    return true if x == elt
  end
  false
end
map(it,f) click to toggle source
# File lib/lib/lambda.rb, line 16
def Lambda.map(it,f)
  l = List.new
  _it = Rb::RubyIterator.new(it)
  while(_it.has_next) do
    x = _it._next
    l.add((f).call(x))
  end
  l
end