No nil reader/writers
Reported by bahuvrihi | March 5th, 2009 @ 11:28 AM
Having a nil reader/writer for a Delegate means the DelegateHash will not delegate get/set operations and instead stores the value internally. For example
def [](key)
return store[key] unless delegate = delegates[key]
case
when bound? && delegate.reader
receiver.send(delegate.reader)
when store.has_key?(key)
store[key]
else
store[key] = delegate.default
end
end
When the reader is nil, key will ALWAYS be used as the storage key and indifferent access (which is implemented through delegates) is no longer respected. Same holds in the analagous writer code.
Nil readers and writers are a weird case and should be removed.
Comments and changes to this ticket
-
bahuvrihi March 5th, 2009 @ 06:34 PM
- Assigned user set to bahuvrihi
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Class configurations that map to the command line.