From dm|tr|@pop@venko @end|ng |rom gm@||@com  Sat Mar  2 15:05:07 2024
From: dm|tr|@pop@venko @end|ng |rom gm@||@com (Dmitri Popavenko)
Date: Sat, 2 Mar 2024 16:05:07 +0200
Subject: [Rd] capture "->"
In-Reply-To: <42ad1f68-4cd6-407b-842a-d9917758d93e@gmail.com>
References: <CAJL_pojF-Qc8YA0_eB+Ab9w3qD5sgMkjm0C3b0ooOmoOUy769w@mail.gmail.com>
 <ff87b48a-ccad-40ec-b79e-3fb4c945d3a9@gmail.com>
 <CAJL_pogbYhhLxsXQN0jjm83sZybh1nO1wE6F+CwNV18F9EkYUA@mail.gmail.com>
 <79f6c330-e5bf-4ad4-9ccc-ed47ab8dcb69@gmail.com>
 <CAJL_poiOUuBfPLqa3uTswA=1LG=1CZeBR9XudSaFQYbesQG+cA@mail.gmail.com>
 <1cef84f8-a9d4-436a-a606-765a084a4a91@gmail.com>
 <005b01da6be5$0361b9f0$0a252dd0$@gmail.com>
 <CAJ=0CtBZPv+Sia-OkGQBCAj+ogSUeTyQ3hVWorbv-DaOZwi64A@mail.gmail.com>
 <003d01da6c1f$b4326b00$1c974100$@gmail.com>
 <CAJ=0CtCdmFC_VQd7arvp5AvkeZzhrJXV=fnB5kDUtdu2b0NA4g@mail.gmail.com>
 <42ad1f68-4cd6-407b-842a-d9917758d93e@gmail.com>
Message-ID: <CAJL_poi4CY+MFCosVROsm89Txai3LZLpp_CS0JRp5PPiUtYykQ@mail.gmail.com>

On Sat, Mar 2, 2024 at 1:31?PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

> You can't change the parser.  Changes like `+` <- `-` change the
> function that is called when the expression contains a function call to
> `+`; this happens in `eval()`, not in `parse()`.  There are never any
> function calls to `->`, because the parser outputs a call to `<-` with
> the operands reversed when it sees that token.
>

Another idea would have been to use "=>", which is disabled by default:
> substitute(A => B)
Error: '=>' is disabled; set '_R_USE_PIPEBIND_' envvar to a true value ...

> Sys.setenv(`_R_USE_PIPEBIND_` = TRUE)
> substitute(A => B)
Error in substitute(`=>`(A, B)) :
  invalid use of pipe bind symbol (<input>:1:0)

The quest is to obtain a valid expression to get past substitute(), but it
proves to be more difficult than I initially thought.
Dmitri

	[[alternative HTML version deleted]]



[Rd] capture "->"
Dmitri Popavenko