[Rd] A bug understanding F relative to FALSE?

Iñaki Ucar |uc@r @end|ng |rom |edor@project@org
Wed Jan 15 15:18:57 CET 2020


On Wed, 15 Jan 2020 at 15:14, IAGO GINÉ VÁZQUEZ <i.gine using pssjd.org> wrote:
>
> Hi all,
>
> Is the next behaviour suitable?
>
> identical(F,FALSE)
>
> ## [1] TRUE
>
> utils::getParseData(parse(text = "c(F,FALSE)", keep.so=rce = TRUE))
>
> ##    line1 col1 line2 col2 id parent                token terminal  text
> ## 14     1    1     1   10 14      0                 expr    FALSE
> ## 1      1    1     1    1  1      3 SYMBOL_FUNCTION_CALL     TRUE     c
> ## 3      1    1     1    1  3     14                 expr    FALSE
> ## 2      1    2     1    2  2     14                  '('     TRUE     (
> ## 4      1    3     1    3  4      6               SYMBOL     TRUE     F
> ## 6      1    3     1    3  6     14                 expr    FALSE
> ## 5      1    4     1    4  5     14                  ','     TRUE     ,
> ## 9      1    5     1    9  9     10            NUM_CONST     TRUE FALSE
> ## 10     1    5     1    9 10     14                 expr    FALSE
> ## 11     1   10     1   10 11     14                  ')'     TRUE     )
>
> I would expect that token for F is the same as token for FALSE.

>From the manual:

‘TRUE’ and ‘FALSE’ are reserved words denoting logical constants
    in the R language, whereas ‘T’ and ‘F’ are global variables whose
    initial values set to these.

Iñaki



More information about the R-devel mailing list