Hello everyone,
I've been doing some research into weak references in ruby and from what I've 
read it seems that Ruby's WeakRef implementation is both inefficient and 
unsafe. Here is the thread discussing the matter:
http://redmine.ruby-lang.org/issues/show/4168

As Macruby has a different garbage collector I don't know if these problems are 
also present?

I am working on a blocks based API for Key Value Coding and need to keep a weak 
reference to objects. 
Here is a very basic example of how this would look in garbage collected 
Objective-C:

@interface Observer : NSObject
{
         __weak id obj;
}

@implementation
- (Observer *)initObservedObject:(id)object
{
        obj = object;
}


Essentially I just need a Macruby equivalent of the above. Is there a simple 
way to have a weak referenced instance variable in Macruby?

al
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to