So, why not have an operator -> such that
obj->method(*args, &block)
is equivalent to (and more efficient than)
lambda {
obj.method(*args, &block)
obj
}
and, then you can add in ()'s around for better chaining:
obj->(sort.replace(&blocky)) # Still returns obj
Then, with destructive methods, you can have
obj->sort!->reject!(&no_like)...
I think this makes sense since the `.' operator is well known as the
`member' operator and for objects, gets the appropriate method (as far
as most languages go). -> has the hanging notion of pointers from
c/c++, but it also makes a bit of conceptual sense here in that we're
sort of `piping' obj forward... the direction of forward is always ->
in left to right reading :-)
~Matt
--
There's no word in the English language for what you do to a dead
thing to make it stop chasing you.