Tiny suggestion:
Automatically lock all the methods in the environments that are used for dictionaries, stacks, etc.
Otherwise, the user can accidentally remove methods (like set()), forcing the user to cre-create the entire object.
Demonstration for clarification:
> d <- dict(list(apple = 5, orange = 10))
> d$set <- NULL
> d$set # this is now changed to "NULL"
NULL
>
> d <- dict(list(apple = 5, orange = 10))
> lockBinding("set", d) # d$set() is now safe
> d$set <- NULL
Error in d$set <- NULL : cannot change value of locked binding for 'set'
> d$set("banana", 3) # this still works
Or is there some issue with locking methods that I don't see?
Hi,
Tiny suggestion: Automatically lock all the methods in the environments that are used for dictionaries, stacks, etc. Otherwise, the user can accidentally remove methods (like
set()
), forcing the user to cre-create the entire object.Demonstration for clarification:
Or is there some issue with locking methods that I don't see?
Kind regards,
Tony.