[Rd] [External] Re: New pipe operator

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Sat Dec 5 08:27:55 CET 2020


On Fri, 4 Dec 2020 20:11:17 -0600 (CST)
luke-tierney using uiowa.edu wrote:

> We did try a number of variations; the code is in the R-syntax branch.
> At the root of that branch are two .md files with some notes as of
> around useR20.

Thanks for the information!

Can I make a suggestion? If the variation of the pipe that allows
a symbol on the RHS to be interpreted as the name of a function to call
does get chosen, may it also allow fully-qualified symbols?

Index: src/main/gram.y
===================================================================
--- src/main/gram.y     (revision 79567)
+++ src/main/gram.y     (working copy)
@@ -1242,7 +1242,11 @@
     if (GenerateCode) {
        /* allow for symbols or lambda expressions */
        if (TYPEOF(rhs) == SYMSXP ||
-           TYPEOF(rhs) == LANGSXP && CAR(rhs) == R_FunctionSymbol)
+           TYPEOF(rhs) == LANGSXP && (
+               CAR(rhs) == R_FunctionSymbol ||
+               CAR(rhs) == R_DoubleColonSymbol ||
+               CAR(rhs) == R_TripleColonSymbol
+           ))
            return lang2(rhs, lhs);
                    
        if (TYPEOF(rhs) != LANGSXP)

Or is this feature creep?

-- 
Best regards,
Ivan

P.S. This lambda function is waving at us: \ (O,o) `/`



More information about the R-devel mailing list