Re: [Rd] "\088" is legal syntax?

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Thu, 01 Sep 2011 20:30:19 -0400

On 11-09-01 5:43 PM, William Dunlap wrote:
> Is it intentional that the digit 8 is allowed
> in octal escape sequences in character literals?
>
> > "\110" == "\088"
> [1] TRUE
> > "\8" == "\b"
> [1] TRUE
>
> 9's are rejected, so I'd expected 8's to be illegal as well.

It is documented that way in the R-lang manual, but I imagine it's just a thinko. It's been like that since octal escapes were added in 1998. I wonder how much will break if I fix it?

Duncan Murdoch

>
> > "\9"
> Error: '\9' is an unrecognized escape in character string starting "\9"
> > "\091")
> Error: embedded nul in string: '\091'
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>> sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> ______________________________________________
> 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 Received on Fri 02 Sep 2011 - 00:33:14 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 Sep 2011 - 01:00:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive