Except for the isolation of local() R pretty much already has the parsing transformation you mention.
as.list(parse(text=" iris ->.; group_by(., Species) ->.; summarize(., mean_sl = mean(Sepal.Length)) ->.; filter(., mean_sl > 5) ")) #> [[1]] #> . <- iris #> #> [[2]] #> . <- group_by(., Species) #> #> [[3]] #> . <- summarize(., mean_sl = mean(Sepal.Length)) #> #> [[4]] #> filter(., mean_sl > 5) <sup>Created on 2019-10-06 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup> > On Oct 5, 2019, at 4:50 PM, Gabriel Becker <gabembec...@gmail.com> wrote: > > > iris %>% group_by(Species) %>% summarize(mean_sl = mean(Sepal.Length)) %>% > filter(mean_sl > 5) > > > were *parsed* as, for example, into > > local({ > . = group_by(iris, Species) > > ._tmp2 = summarize(., mean_sl = mean(Sepal.Length)) > > filter(., mean_sl > 5) > }) > > > > > Then debuggiing (once you knew that) would be much easier but behavaior > would be the same as it is now. There could even be some sort of > step-through-pipe debugger at that point added as well for additional > convenience. > > There is some minor precedent for that type of transformative parsing: > >> expr = parse(text = "5 -> x") > >> expr > > expression(5 -> x) > >> expr[[1]] > > x <- 5 > > > Though thats a much more minor transformation. ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel