I've coded an experimental function which makes passed objects chainable by using high order functions. It's name is "chain" for now, and here is a usage example;
chain("Hello World")
(print) // evaluates print function by passing "Hello World" object.
(console.log,"Optional","Parameters")
(returnfrom) // returns "Hello World"
It looks lispy but behaves very different since it's coded in a C based language, I don't know if there is a name for this idiom and I couldn't any name more suitable than "chain".
Any ideas, suggestions?
edit: "with" sounds very suitable name but it's a reserved word in the language I'm working on.