# NOT RUN {
# You can supply a function taking a condition as argument:
hnd <- exiting(function(c) cat("handled foo\n"))
with_handlers(cnd_signal("foo"), foo = hnd)
# Or a lambda-formula where "." is bound to the condition:
with_handlers(foo = inplace(~cat("hello", .$attr, "\n")), {
cnd_signal("foo", attr = "there")
"foo"
})
# }
Run the code above in your browser using DataLab