Abby: Just one other thing. A friend of mine recommended reading the R-language manual which I haven't read in many years. I don't know if it's because I'm more expeRienced or just plain oldeR but I started it today and it's not nearly as daunting as I remember it being in the past. It's going to take me some time but I highly recommend checking it out if you haven't already. Maybe it's like a fine wine and just gets better with age !!!!!!! Good luck.
Mark ---------- Forwarded message --------- From: Abby Spurdle <spurdl...@gmail.com> Date: Sun, May 3, 2020 at 6:19 AM Subject: Re: [R] stats:: spline's method could not be monoH.FC To: Mark Leeds <marklee...@gmail.com> Cc: Martin Maechler <maech...@stat.math.ethz.ch>, Samuel Granjeaud IR/Inserm <samuel.granje...@inserm.fr>, r-help <r-help@r-project.org> Hi Mark, The article is good. However, there's still some grey areas. The documentation for base::typeof equates a closure with a function. However, the article defines a closure as a function together with an environment. A very minor difference I know, but it creates the problem that the word closure is used inconsistently. And that's without even getting into "frames". Equating a closure with a function (only), is perhaps misleading...??? Also, re-iterating I use function objects with attributes. (I prefer this approach, because I can make copies of function objects, and if necessary modify them). My guess is that doesn't meet the definition of an R closure (if you ignore the environment)...???, and it's unclear whether it meets the definition of a closure, more generally...??? So, I've still got the same problem, of how to refer to functions that have *either* attributes *or* environments, containing data. Maybe I should just stick to "Self-Referencing Function Objects" and "Functions Bundled with Data"...??? One last thing, the last time I read S4 documentation, I couldn't tell if it was possible to have S4-based function objects, and if so, could the body of the S4-based function object (while being called) access it's own slots...??? On Sun, May 3, 2020 at 4:27 PM Mark Leeds <marklee...@gmail.com> wrote: > > Abby: Here is an article on environments/closures which might be useful to you. I was reviewing environments recently and it > was a clear explanation of how environments/closures work in R. Even though it's from 2000, I'm pretty certain that everything > said in it still holds. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.