renkun-ken / pipeR

Multi-Paradigm Pipeline Implementation
Other
167 stars 39 forks source link

Easy lambda expression #7

Closed renkun-ken closed 10 years ago

renkun-ken commented 10 years ago

A more F#-like pipeline operator %|>% may be defined so that the following code can be allowed:

rnorm(100) %|>% (x -> plot(x))

In the code above, %|>% interprets -> as the connector between a customized symbol x and the expression it goes to. -> does not mean assign here. Is it a good idea? One issue is that it may not be compatible with formatR packages that, by default, will put all -> to <-, which in this case makes the code harder to read.

renkun-ken commented 10 years ago

Resolved.