R-alpha: Version 0.50-a1 patches -- New and old bugs..

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Tue, 5 Aug 1997 12:44:48 +0200


Thank you !
~~~~~~~~~~~

The new patches
	 (which incidentally make  0.50-a1 into  0.50-a2
	  IF you run ./configure)
really do quite a few good things.

A few comments.

1) I had to do the following to make things compile and link properly

   in	appl/cpoly.c :  line  42 : OUT-commented  (pow_di) 
   otherwise compiler barfed about redefined  pow_di	[Solaris 2.5, Sun cc]

2) In order for 'legend' and 'barplot' to work I had to edit
	src/library/base/funs/legend: 
   Last line: replace 'text=' by 'labels='  [reflect change of text(...)]

NOTE: After applying the patch, I recommend the following

    make clean
    configure
    make
    make install
    make tests install-latex install-help install-html

---------------------
Further notes:

3) Whereas  unlist(1), unlist(c(2)), etc. work,
   the two unlist problems that Kurt reported about,
   especially

    l.ex <- list(a = list(1:5, LETTERS[1:5]), b = "Z", c = NA)
    unlist(l.ex) #-- still in 0.50-a2
    ##- INTERNAL ERROR: ans_nnames = 10    ans_length = 12
    ##- Error: incorrect names vector length

 still exist. {Nobody claimed otherwise}


4) The parser problem reported by Patrick Lindsey remains :

  ##- From: Patrick Lindsey <plindsey@luc.ac.be>
  ##- Date: Tue, 29 Jul 1997 11:28:50 +0200 (MET DST)
  ##- To: r-devel@stat.math.ethz.ch (R list)
  ##- Subject: R-alpha: Bugs in R-0.50-a1.
  ##-
  ##- Problems in R but not in S:
  ##- ---------------------------

  ##- 2) Problem with the parser: When a function contains a condition
  ##- between brackets the closing bracket must be adjacent to the last item
  ##- in R but not in S. Here is an example:
  ##- 	S> new <- function (x,y,z,k) {
  ##- 	S+ message <- list(x,y,a=if(z) k
  ##- 	S+ )
  ##- 	S+ message
  ##- 	S+ }
  ##- 	S>
  ##- 	---
  ##- 	R> new <- function (x,y,z,k) {
  ##- 	R+ message <- list(x,y,a=if(z) k
  ##- 	R+ )
  ##- 	)
  ##- 	^
  ##- 	Error: syntax error
  ##- 	R>
  ##- This occurs in R-0.49 and in R-0.50-a1, R-0.50-a2

  new <- function (x,y,z,k) {
    message <- list(x,y, a=if(z) k
		    )
  }

---------------------------------------------------------------------------
I think I found one  NEW bug  (a1 -> a2):
		     =======
  	options(digits = ...) fails to work AT ALL in a 'local environment'

which makes even my  tst2()  function 'fail' :
  

 p0 <- (0:2)/1000 ; p <- p0 + 1e-10
 p
 ## Fails in 0.50-a2, (NOT in 0.50-a1, I think):
 for(d in 1:20) { options(digits=d); cat(d,": ", p,";\t",p0, "  ");print(p)}
 options(digits=7)
 ## Now,the print(.) at least works:
 for(d in 1:20) { options(digits=d); cat(d,": ", p,";",p0, "  ");print(p,dig=d)}

 ##-- The following does not work as it should in  R (0.50-a1, maybe earlier)
 tst <- function(x=pi, dig =3) {.Options$digits <- as.integer(dig); print(x);x}
 tst()
 tst(dig = 12)
 ##-- This should do the same; works as expected in S & R-0.50-a1, NOT in -a2:
 tst2 <- function(x=pi, dig =3) {
   oo <- options(digits=dig); on.exit(options(oo)); print(x);x}
 tst2()
 tst2(dig = 12)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-