[Rd] clients and carriage returns

From: Joe Conway <mail_at_joeconway.com>
Date: Wed, 20 Jun 2007 09:57:48 -0700


I've recently ported PL/R (R embedded in Postgres as a procedural language) to work on Win32 -- thank you to all involved for making the embedded interface common between *nix and Win32!

This of course means users are now creating PL/R functions using Win32 based editors, which are using \r\n for EOL. I had not realized this before, but R throws a parse error when it sees \r, even on a Win32 OS. Near as I can tell browsing R source, this is true on all operating systems -- e.g. gram.y seems to look only for \n, and in src/gnuwin32/graphapp/events.c:handle_char(), \r is actively replaced with \n. I didn't find any specific mention of EOL/newline in "Writing R Extensions", and only reference to related escape sequences in "R Language Definition".

My questions:
- Is it safe (and indeed proper) for PL/R to always convert \r\n to

   \n prior to invoking the R parser?
- Should the same be done for \r to \n (e.g. on OS X)?

Thanks,

Joe



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 20 Jun 2007 - 17:07:57 GMT

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 Wed 20 Jun 2007 - 20:37:16 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.