From istazahn at gmail.com  Tue Aug  5 21:18:54 2014
From: istazahn at gmail.com (Ista Zahn)
Date: Tue, 5 Aug 2014 15:18:54 -0400
Subject: [Rd] Is it a good idea or even possible to redefine attach?
In-Reply-To: <CAAjq1mfLzRdcYRb4waXBYx6t7h6rr7u0rkJDCGgySf9LaSYi2A@mail.gmail.com>
References: <CAAjq1mfLzRdcYRb4waXBYx6t7h6rr7u0rkJDCGgySf9LaSYi2A@mail.gmail.com>
Message-ID: <CA+vqiLFYhZY0Hx2=GNf=H-hO6M6aC+U701f1e3Ok9Rg08JVCTQ@mail.gmail.com>

On Tue, Aug 5, 2014 at 2:49 PM, Grant Rettke <gcr at wisdomandwonder.com> wrote:
> Hi,
>
> Today I got curious about whether or not I /could/ remove `attach' from
> my system so:
> - Backed it up
> - Implemented a new one
> - Like this
>
> ,----
> | attach.old <<- attach
> | attach <<- function(...) {stop("NEVER USE ATTACH")}
> `----

Just masking it with your own function, e.g.,

attach <- function(...) {stop("NEVER USE ATTACH")}

should be enough to discourage you from using it.

>
> I got the error:
>
> ,----
> | Error: cannot change value of locked binding for 'attach'
> `----
>
> If I unlock `attach' I assume that I could stomp on it... however is
> that even a good idea?
>
> What will I break?

Anything that uses attach.

>
> My goal was never to allow `attach' in my system, but it was just an
> idea.
>
> Kind regards,
>
> Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
> gcr at wisdomandwonder.com | http://www.wisdomandwonder.com/
> ?Wisdom begins in wonder.? --Socrates
> ((? (x) (x x)) (? (x) (x x)))
> ?Life has become immeasurably better since I have been forced to stop
> taking it seriously.? --Thompson
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Is it a good idea or even possible to redefine attach?
Ista Zahn