I was considering something like this to be used in manipulations of parse trees.
I've tried investigating such things, mostly for LDT (Eclipse's Lua plugin), but I didn't end up with anything practical. However, creating a small DSL based chained invocations, _a la_ JQuery, gave much more expressive results.