From romain.francois at dbmail.com  Thu Feb 12 13:01:03 2009
From: romain.francois at dbmail.com (Romain Francois)
Date: Thu, 12 Feb 2009 13:01:03 +0100
Subject: [Rd] Why is srcref of length 6 and not 4 ?
Message-ID: <49940F7F.3090508@dbmail.com>

Hello,

Consider this file (/tmp/test.R) :

<file>
f <- function( x, y = 2 ){
   z <- x + y
   print( z )
}
</file>

I get this in R 2.7.2 :

 > p <- parse( "/tmp/test.R" )
 > str( attr( p, "srcref" ) )
List of 1
$ :Class 'srcref'  atomic [1:4] 1 1 4 1
 .. ..- attr(*, "srcfile")=Class 'srcfile' length 4 <environment>

and this in R-devel :

 > p <- parse( "/tmp/test.R" )
 > str( attr(p, "srcref") )
List of 1
$ :Class 'srcref'  atomic [1:6] 1 1 4 1 1 1
 .. ..- attr(*, "srcfile")=Class 'srcfile' <environment: 0x946b944>

What are the two last numbers ?

Romain

-- 
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr

-- 
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr



[Rd] Why is srcref of length 6 and not 4 ?
Romain Francois