1

I'm currently studying about frames, environments in R using Advanced R.

But I can't quite understand the last paragraph of this section.

The frame also holds exit handlers created with on.exit(), restarts and handlers for the condition system, and which context to return() to when a function completes. These are important internal details that are not accessible with R code.

I know stats, but I'm not good with computer science.
Also, I can't read this paragraph as is.

To my understanding,
1. Each frame holds exit controller(which I think handler means) named on.exit().
2. This controller restarts and controls condition system.
3. I can't even understand how to read "and which context to return() to when a function completes.".

To summarise what I'm not getting is,
1. Are two of above 3 sentences right?
2. What is the meaning of the 3rd sentence? What does "which" refer to? What is the verb of this sentence?
3. What is "condition system"? Is it the same thing with "condition statement"?

As I said before, I have poor cs background.

Thanks in advance.

HyeonPhil Youn
  • 428
  • 4
  • 11
  • Just found out that the book covers 'exit handler' in the previous chapter. It's a shame that I missed it, wanna put on hold until I cover, but I'll keep open just in case someone writes an answer. – HyeonPhil Youn Dec 28 '19 at 17:25
  • Re: question three there; see `?conditions` or `help("conditions")` from R – duckmayr Dec 28 '19 at 17:26
  • 1
    2) The verb is *to return*. When a function returns, it returns to what? The *context* includes the variables and other objects that exist in that environment, their values, the state of the stack, etc. – Rui Barradas Dec 28 '19 at 17:30
  • @RuiBarradas-ReinstateMonic So, the frame restarts and handles which context to return to / when a function completes. Is this right? I think it makes sense. – HyeonPhil Youn Dec 28 '19 at 17:40
  • 2
    Suppose you are in a building and go up one level. Then you exit/return to the previous level. That is the context, with all its variables, etc. The handlers control this, the context/level to return to. – Rui Barradas Dec 28 '19 at 17:44

0 Answers0