Pipe syntax for formulae

Hi,

Some programming languages have a very handy pipe syntax (e.g. R tidyverse with magrittr package ‘%>%’ (the ‘pipe’ operator). This chains operations together and improves readability of consecutive applications of several functions.

It would be nice if we could use some sort of pipe syntax in the formula editor.

For example. If we want to apply a function like right() first and left() second, we could have something like (Mystring piped into right() and that result piped into left()

“MyString” %>%
right(, 4) %>%
left(, 2)

There is an idea how we can do it in EasyMorph:

Two operators:

>> remembers the preceding value.
_ recalls the last remembered value.

Your example would look like this:

“MyString” >> right(_, 4) >> left(_, 2)

An alternative notation for the "remember" operator is . instead of >>. With that notation, the example would be:

“MyString”.right(_, 4).left(_, 2)

But we think it's less readable.

Thoughts?

@dgudkov

The double arrow seems to be more readable. The dot notation relates to object oriented programming.