|
|
|
|
|
by masklinn
391 days ago
|
|
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
}
|
|