Re: [R] Does R have a "const object"?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 1:12 PM, wrote: > On Wed, 16 Mar 2011, Gabor Grothendieck wrote: > >> On Wed, Mar 16, 2011 at 12:16 PM,   wrote: >>> >>> On Wed, 16 Mar 2011, Gabor Grothendieck wrote: >>> On Wed, Mar 16, 2011 at 11:49 AM,   wrote: > > Just as a heads-up: it is likely that unl

Re: [R] Does R have a "const object"?

2011-03-16 Thread Hadley Wickham
>> Its useful for being able to set defaults for arguments that do not >> have defaults.  That cannot break existing programs. > > Until the next program decides do co change those defaults and either > can't or does and you end up with incompatible assumptions.  It also > make the code with the ad

Re: [R] Does R have a "const object"?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 12:16 PM, wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM,   wrote: Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPEC

Re: [R] Does R have a "const object"?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Barry Rowlingson wrote: On Wed, Mar 16, 2011 at 4:16 PM, wrote: That would defeat the purpose.  Unlocking things in base may be useful for experimenting or debugging but it is not a good idea otherwise. You are making experimenting in R more awkward? Then I'm throwing

Re: [R] Does R have a "const object"?

2011-03-16 Thread Barry Rowlingson
On Wed, Mar 16, 2011 at 4:16 PM, wrote: > That would defeat the purpose.  Unlocking things in base may be useful > for experimenting or debugging but it is not a good idea otherwise. You are making experimenting in R more awkward? Then I'm throwing "That would defeat the purpose" straight back

Re: [R] Does R have a "const object"?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 12:16 PM, wrote: > On Wed, 16 Mar 2011, Gabor Grothendieck wrote: > >> On Wed, Mar 16, 2011 at 11:49 AM,   wrote: >>> >>> Just as a heads-up: it is likely that unlocking the bindings in base >>> for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly >>> more

Re: [R] Does R have a "const object"?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM, wrote: Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly more, will start signaling warnings in the near future.  Doing thi

Re: [R] Does R have a "const object"?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 11:49 AM, wrote: > Just as a heads-up: it is likely that unlocking the bindings in base > for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly > more, will start signaling warnings in the near future.  Doing this > may be useful at times for debugging but

Re: [R] Does R have a "const object"?

2011-03-16 Thread Henrik Bengtsson
On Wed, Mar 16, 2011 at 6:04 AM, Michael Friendly wrote: > On 3/15/2011 2:23 PM, Uwe Ligges wrote: >> >> >> On 15.03.2011 15:53, xiagao1982 wrote: >>> >>> Hi, all, >>> >>> Does R have a "const object" concept like which is in C++ language? I >>> want to set some data frames as constant to avoid be

Re: [R] Does R have a "const object"?

2011-03-16 Thread luke-tierney
Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly more, will start signaling warnings in the near future. Doing this may be useful at times for debugging but it can mess up assumptions others make about how t

Re: [R] Does R have a "const object"?

2011-03-16 Thread Allan Engelhardt
On 16/03/11 15:04, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 10:54 AM, Allan Engelhardt wrote: [...] Yes, but you can still print(base::pi) and rm(pi) to get back to our flat world, and you can't assign("pi", 4, pos = "package:base") Error in assign("pi", 4, pos = "package:base") :

Re: [R] Does R have a "const object"?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 10:54 AM, Allan Engelhardt wrote: > > > On 16/03/11 13:04, Michael Friendly wrote: >> >> On 3/15/2011 2:23 PM, Uwe Ligges wrote: >>> >>> >>> On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a "const object" concept like which is in C++ languag

Re: [R] Does R have a "const object"?

2011-03-16 Thread Allan Engelhardt
On 16/03/11 13:04, Michael Friendly wrote: On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks!

Re: [R] Does R have a "const object"?

2011-03-16 Thread Dieter Menne
Michael Friendly wrote: > > This is just the flexibility of R. I've just discovered a new class of > geometries based on > > > pi <- 2.3 > ?Constants > This is a must-fortune. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Does-R-have-a-const-object-tp3356972p3381

Re: [R] Does R have a "const object"?

2011-03-16 Thread Michael Friendly
On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a "No" in R

Re: [R] Does R have a "const object"?

2011-03-16 Thread Allan Kamau
y in a >> subroutine call. >> >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On >> Behalf Of Uwe Ligges >> Sent: Tuesday, March 15, 2011 2:23 PM >> To: xiagao1982 >> Cc: r-help >> Subject:

Re: [R] Does R have a "const object"?

2011-03-15 Thread Thomas Lumley
mailto:r-help-boun...@r-project.org] On > Behalf Of Uwe Ligges > Sent: Tuesday, March 15, 2011 2:23 PM > To: xiagao1982 > Cc: r-help > Subject: Re: [R] Does R have a "const object"? > > > > On 15.03.2011 15:53, xiagao1982 wrote: >> Hi, all, >> >&

Re: [R] Does R have a "const object"?

2011-03-15 Thread rex.dwyer
igges Sent: Tuesday, March 15, 2011 2:23 PM To: xiagao1982 Cc: r-help Subject: Re: [R] Does R have a "const object"? On 15.03.2011 15:53, xiagao1982 wrote: > Hi, all, > > Does R have a "const object" concept like which is in C++ language? I want to > set some d

Re: [R] Does R have a "const object"?

2011-03-15 Thread Duncan Murdoch
On 15/03/2011 2:35 PM, Martin Morgan wrote: On 03/15/2011 11:34 AM, Duncan Murdoch wrote: > On 15/03/2011 2:23 PM, Uwe Ligges wrote: >> >> On 15.03.2011 15:53, xiagao1982 wrote: >> > Hi, all, >> > >> > Does R have a "const object" concept like which is in C++ language? >> I want to set so

Re: [R] Does R have a "const object"?

2011-03-15 Thread Uwe Ligges
On 15.03.2011 19:35, Martin Morgan wrote: On 03/15/2011 11:34 AM, Duncan Murdoch wrote: On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: > Hi, all, > > Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constan

Re: [R] Does R have a "const object"?

2011-03-15 Thread Gabor Grothendieck
On Tue, Mar 15, 2011 at 10:53 AM, xiagao1982 wrote: > Hi, all, > > Does R have a "const object" concept like which is in C++ language? I want to > set some data frames as constant to avoid being modified unintentionally. > Thanks! > > LockBinding will prevent a variable from being modified (but

Re: [R] Does R have a "const object"?

2011-03-15 Thread Martin Morgan
On 03/15/2011 11:34 AM, Duncan Murdoch wrote: On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: > Hi, all, > > Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Th

Re: [R] Does R have a "const object"?

2011-03-15 Thread Duncan Murdoch
On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: > Hi, all, > > Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a "No

Re: [R] Does R have a "const object"?

2011-03-15 Thread Uwe Ligges
On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a "No" in R, the best short answer is: "No". Best,

[R] Does R have a "const object"?

2011-03-15 Thread xiagao1982
Hi, all, Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! xiagao1982 2011-03-15 [[alternative HTML version deleted]] __ R-help@