[Rd] capture "->"

Dmitri Popavenko dm|tr|@pop@venko @end|ng |rom gm@||@com
Sun Mar 3 13:25:15 CET 2024


On Sat, Mar 2, 2024 at 7:58 PM Gabor Grothendieck <ggrothendieck using gmail.com>
wrote:

> 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
>

Yes, to pass as a formula would be the idea.
It's just that the parser inverses "~A -> result" into "result <- ~A".
We are seeking for any way possible to flag this inversion.

Avi, thank you for your efforts too. Wrapping symbols into percent signs is
an option, but as Duncan says it is much more intuitive to just quote the
expression.
The challenge is to somehow flag the parser inversion, otherwise a quoted
expression seems to be the only solution possible.

Regards,
Dmitri

	[[alternative HTML version deleted]]



More information about the R-devel mailing list