From ggrothend|eck @end|ng |rom gm@||@com  Sat Mar  2 18:57:34 2024
From: ggrothend|eck @end|ng |rom gm@||@com (Gabor Grothendieck)
Date: Sat, 2 Mar 2024 12:57:34 -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: <CAP01uRk-aKErTBoWNUeFaF23doSJP5v8nz4WGT+jxCgiFXip7A@mail.gmail.com>

Would it be good enough to pass it as a formula?  Using your definition of foo

  foo(~ A -> result)
  ## result <- ~A

  foo(~ result <- A)
  ## ~result <- A

On Fri, Mar 1, 2024 at 4:18?AM Dmitri Popavenko
<dmitri.popavenko at gmail.com> 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 <-
>
> Thank you,
> Dmitri
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



[Rd] capture "->"
Gabor Grothendieck