-
-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Some languages provide pipeline operators or alike for use with imperative functions/methods:
- Clojure provides
dotothat works like->, except that each forms are evaluated and discarded, and the original value is returned. For example,(doto (new java.util.HashMap) (.put "a" 1) (.put "b" 2))initiates a Java mutable hash table (see the ClojureDocs page). - In Kotlin,
.apply(with receiver) and.also(with argument) are available as extension methods on objects (see Kotlin scope functions). - (Unfortunately, I couldn’t find a precedent on a
.- or|>-like tap operator.)
This operation is also known as “tap” or “tee”. Is this a useful addition to Rhombus?
Metadata
Metadata
Assignees
Labels
No labels