Skip to content

pos.to.env and sys.xxx documentation (PR#801)

2 messages · pperkins@ucsd.edu, Peter Dalgaard

#
Full_Name: peter perkins
Version: 1.2.0
OS: linuxppc
Submission from: (NULL) (24.4.89.36)


i'm assuming that these are shortfalls in the documentation, and not bugs
in the function themselves.

1) the help page for pos.to.env gives two examples:

   Examples:

     pos.to.env(1)
     pos.to.env(length(search()))

the second of these returns NULL which (to me) does not seem to fit
the description of the function.  an explanation of why this seems
to be a special case would be helpful.


2)  the help page for the sys.xxx functions says:

   Notice that even though the `sys.'xxx functions are interpreted,
   their contexts are not counted nor are they reported. There is no
   access to them.

sys.status() seems to violate this description:
$sys.calls
$sys.calls[[1]]
test()

$sys.calls[[2]]
sys.status()


$sys.parents
[1] 0 1

$sys.frames
$sys.frames[[1]]
<environment: 0x10bf7a94>

$sys.frames[[2]]
<environment: 0x10bf7a5c>


3) the sys.xxx help page says:

   The parent of a function evaluation is the environment in which
   the function was called. It is not necessarily one less than the
   frame number of the current evaluation, nor the environment from
   which it is called.

i think the first sentence ought to read "the environment in which the
function was declared".  unless there is some syntactic subtlety that
makes the environment "in which [it] was called" different from the one
"from which [it] is called".

- peter

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
pperkins@ucsd.edu writes:
This is correct. The NULL environment is at the end of the search list
(also known as "package:base"). It is a feature not very much loved by
me, but a feature nevertheless. In this environment, objects are bound
directly to symbols rather than stored in a hash structure.
Close, but it's the *second* sentence that needs to be changed...