Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-13 Thread Bill Dunlap
I agree that the precedence looks reasonable. E.g., > str.language(quote(A > 0 & A<=B & B <= C => A <= C & 0 < C)) language: `=>`(A > 0 & A <= B & B <= C, A <= C ... symbol: => language: A > 0 & A <= B & B <= C symbol: & language: A > 0 & A <= B symbol: & language: A > 0

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Duncan Murdoch
On 12/01/2021 3:52 p.m., Bill Dunlap wrote: '=>' can be defined as a function. E.g., it could be the logical "implies" function: > `=>` <- function(x, y) !x | y > TRUE => FALSE [1] FALSE > FALSE => TRUE [1] TRUE It might be nice then to have deparse() display it as an

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Bill Dunlap
'=>' can be defined as a function. E.g., it could be the logical "implies" function: > `=>` <- function(x, y) !x | y > TRUE => FALSE [1] FALSE > FALSE => TRUE [1] TRUE It might be nice then to have deparse() display it as an infix operator instead of the current prefix: >

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Dirk Eddelbuettel
On 12 January 2021 at 20:38, Iñaki Ucar wrote: | On Tue, 12 Jan 2021 at 20:23, wrote: | > | > After some discussions we've settled on a syntax of the form | > | > mtcars |> subset(cyl == 4) |> d => lm(mpg ~ disp, data = d) | > | > to handle cases where the pipe lhs needs to be passed to an

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Iñaki Ucar
On Tue, 12 Jan 2021 at 20:23, wrote: > > After some discussions we've settled on a syntax of the form > > mtcars |> subset(cyl == 4) |> d => lm(mpg ~ disp, data = d) > > to handle cases where the pipe lhs needs to be passed to an argument > other than the first of the function called on the

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread luke-tierney
After some discussions we've settled on a syntax of the form mtcars |> subset(cyl == 4) |> d => lm(mpg ~ disp, data = d) to handle cases where the pipe lhs needs to be passed to an argument other than the first of the function called on the rhs. This seems a to be a reasonable balance