Hello Henrik,
On Nov 13, 2009, at 3:42 PM, Henrik Bengtsson wrote:
> If you develop your own code you can add your own behavior by
> "extending" the environment class. I put "extending" in quotation
> marks, because 'environment' is one of few classes you should *not*
> extend from in the regula
On Nov 13, 2009, at 2:47 PM, Duncan Murdoch wrote:
> Inconsistent with what happens for lists:
>
> > x <- list()
> > x$b
> NULL
>
> and attributes:
>
> > attr(x, "b")
> NULL
Ah, I see. I would claim that the same argument for default safety should apply
here too.
> It is already a little st
Hello Duncan,
Thanks for your reply.
On Nov 13, 2009, at 2:27 PM, Duncan Murdoch wrote:
> You get the same behaviour when asking for a nonexistent element of a list,
> or a nonexistent attribute. If you want stricter checking, don't use $, use
> get():
>
> > get("b", e)
> Error in get("b",
Greetings everyone,
I have a question about the default behaviour of a missing entry in an
environment.
Let us look at the following sequence of R statements:
> e <- new.env()
> e$a <- 1
> e$a
[1] 1
> e$b
NULL
>
I think I understand the logic for returning NULL to a missing entry in an
enviro