From hpages at fhcrc.org  Wed May  7 23:17:35 2014
From: hpages at fhcrc.org (=?windows-1252?Q?Herv=E9_Pag=E8s?=)
Date: Wed, 07 May 2014 14:17:35 -0700
Subject: [Rd] precedence (was 'historical NA question')
In-Reply-To: <7CC02BBE-3F5D-4A11-87A1-F8B013BD081F@r-project.org>
References: <3dfcdc$gnkvcv@ironport9.mayo.edu>
	<536A5C52.4030907@r-project.org> <536A8B72.802@fhcrc.org>
	<7CC02BBE-3F5D-4A11-87A1-F8B013BD081F@r-project.org>
Message-ID: <536AA2EF.9060301@fhcrc.org>

On 05/07/2014 12:52 PM, Simon Urbanek wrote:
> On May 7, 2014, at 3:37 PM, Herv? Pag?s <hpages at fhcrc.org> wrote:
>
>> No big deal. These things can be tricky:
>>
>> https://stat.ethz.ch/pipermail/r-devel/2006-January/036022.html
>>
>> Sorry I couldn't resist ;-)
>>
>
> Yeah, but that's just yet another trip down the rabbit hole - why is -2 parsed as `-`(2) and not a single constant?

You wouldn't want -2 to be parsed as a single constant exactly for
the reason that you wouldn't want -2^2 to return 4. Having -2^2 treated
the same way as -x^2 is a sane feature.

> Is there a way to express a negative constant in R? Hmm?

Maybe some people have some use cases for this (speed ?).
Personally I don't. Of course it would require a special syntax,
something that would probably be as ugly and confusing as the
L suffix used for integer constants (L means long int in C).

H.

>
>
>> On 05/07/2014 09:16 AM, John Chambers wrote:
>>> On 5/7/14, 5:21 AM, Therneau, Terry M., Ph.D. wrote:
>>>> Hadley asked about the Blue book; my shelf still has the earlier brown
>>>> book
>>>>     Becker and Chambers, 1984, S: An interactive environment for data
>>>> analysis and graphics.
>>>
>>> Historically interesting, but there was never a guarantee that Version 3
>>> of S (the "blue book") was back-compatible with earlier versions.  We
>>> gave users some help in "getting on the road" to converting, that was
>>> all (see Appendix 4 to the blue book).
>>>
>>> For that one brief moment, we felt free to innovate.
>>>
>>> John
>>>
>>>>
>>>> The manual page for precedence is
>>>>
>>>> $               component select
>>>> %x              special operator
>>>> -               unary minus
>>>> :               sequence operator
>>>> ^ **            exponentiation
>>>> * /             mult/div
>>>> + -             add/sub
>>>> < > <= >= == != logical
>>>> !               not
>>>> & |             and/or
>>>> <- ->           assignment
>>>>
>>>> Terry Therneau
>>>>
>>>> ______________________________________________
>>>> R-devel at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> --
>> Herv? Pag?s
>>
>> Program in Computational Biology
>> Division of Public Health Sciences
>> Fred Hutchinson Cancer Research Center
>> 1100 Fairview Ave. N, M1-B514
>> P.O. Box 19024
>> Seattle, WA 98109-1024
>>
>> E-mail: hpages at fhcrc.org
>> Phone:  (206) 667-5791
>> Fax:    (206) 667-1319
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] precedence (was 'historical NA question')
=?windows-1252?Q?Herv=E9_Pag=E8s?=