From murdoch@dunc@n @end|ng |rom gm@||@com  Fri Mar  1 10:30:37 2024
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Fri, 1 Mar 2024 04:30:37 -0500
Subject: [Rd] capture "->"
In-Reply-To: <CAJL_pojF-Qc8YA0_eB+Ab9w3qD5sgMkjm0C3b0ooOmoOUy769w@mail.gmail.com>
References: <CAJL_pojF-Qc8YA0_eB+Ab9w3qD5sgMkjm0C3b0ooOmoOUy769w@mail.gmail.com>
Message-ID: <ff87b48a-ccad-40ec-b79e-3fb4c945d3a9@gmail.com>

On 01/03/2024 4:17 a.m., Dmitri Popavenko wrote:
> Hi everyone,
> 
> I am aware this is a parser issue, but is there any possibility to capture
> the use of the inverse assignment operator into a formula?
> 
> Something like:
> 
>> foo <- function(x) substitute(x)
> 
> gives:
> 
>> foo(A -> B)
> B <- A
> 
> I wonder if there is any possibility whatsoever to signal the use of ->
> instead of <-

If you parse it with srcrefs, you could look at the source.  The parser 
doesn't record whether it was A -> B or B <- A anywhere else.

Duncan Murdoch



[Rd] capture "->"
Duncan Murdoch