On Wednesday, July 30, 2003, at 01:33 PM, Thomas Reed wrote:
Given that modules are not objects but are still logical holders of
global
methods and properties, is it technically possible to add
constructor/destructor functionality to initialize properties?
Sure, it's possible. But why? Wouldn't it make more sense to use a
class for this sort of thing? Seems to me like you're saying "My
nails don't seem to be compatible with a screwdriver -- can we add a
slot in the top of the nail and put threads on the shaft of the nail?"
Why bother, just go get a screw. Use the right tool for the job.
It looks like a good way to implement singleton classes in Rb in
situations where inheritance isn't needed.
Charles Yeomans
---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.
|