Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Smalltalk's "method cascading" (the `;` operator) did roughly that. I don't think you're forking an entire sequence of methods though, it just allows performing operations on the same root object e.g.

    a foo
    ; bar
    ; baz
would sequentially send "foo", "bar" then "baz" to "a", then would return the result of the last call.

The ability to fork iterators (which may be the semantics you're actually interested in) also exists in some languages e.g. Python (itertools.tee) or Rust (some iterators are clonable)



I see.. but I wonder if st syntax allows for more than methods:

    a (foo duh meh) <- classic composition here
    ; bar
    ; baz


I don't think the first line is even valid, it translates to

    a.(foo.duh.meh)
in e.g. ruby.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: