Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

higher order function, function taking an other function (/ block).

E.g. in Ruby you can lock/unlock a mutex, but the normal way to do it would be to pass a block to `Mutex#synchronize` which is essentially just

  def synchronize
    lock
    begin
      yield
    ensure
      unlock
    end
  end
and called as:

  lock.synchronize {
    # protected code here
  }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: