From xie at yihui.name  Sun Apr 10 20:08:14 2011
From: xie at yihui.name (Yihui Xie)
Date: Sun, 10 Apr 2011 13:08:14 -0500
Subject: [Rd] deparse operators in expressions
In-Reply-To: <4DA1AE95.8040300@gmail.com>
References: <BANLkTimQLeAeinPnK8JK6nrxANT_knUn0Q@mail.gmail.com>
	<4DA1AE95.8040300@gmail.com>
Message-ID: <BANLkTimWSBBd_we+FUcCREW_sVKimdjyig@mail.gmail.com>

Thanks for pointing out the direction. Since this is unlikely to
change in base R, is it possible to change from an add-on package?

I think it is reasonable to eliminate spaces around ^ and :, but I
don't understand why /, %% and %/% should be different with other
arithmetic operators like +, - and *.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Apr 10, 2011 at 8:20 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 11-04-09 9:43 PM, Yihui Xie wrote:
>>
>> Hi,
>>
>> I observed a slight problem in deparse(): it will add spaces around
>> most operators except /. I wonder if this is easy to fix. I know this
>> is quite trivial, but I will appreciate if / is not treated as an
>> exception. Examples:
>
> It's easy to change: ?take a look at src/main/deparse.c. ?The operators that
> are labelled as PP_BINARY2 get no spaces. ?Looking in src/main/names.c, we
> see those are /, ^, %%, %/% and :.
>
> But clearly this is by design, and I think it's unlikely to change.
>
> Duncan Murdoch
>



[Rd] deparse operators in expressions
Yihui Xie