[macruby-changes] [4370] MacRuby/trunk/variable.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 20 23:03:23 PDT 2010


Revision: 4370
          http://trac.macosforge.org/projects/ruby/changeset/4370
Author:   lsansonetti at apple.com
Date:     2010-07-20 23:03:19 -0700 (Tue, 20 Jul 2010)
Log Message:
-----------
implement #remove_instance_variable for RubyObjects

Modified Paths:
--------------
    MacRuby/trunk/variable.c

Modified: MacRuby/trunk/variable.c
===================================================================
--- MacRuby/trunk/variable.c	2010-07-16 17:54:55 UTC (rev 4369)
+++ MacRuby/trunk/variable.c	2010-07-21 06:03:19 UTC (rev 4370)
@@ -1242,7 +1242,16 @@
 
     switch (TYPE(obj)) {
 	case T_OBJECT:
-	    // TODO
+	    {
+		const int slot = rb_vm_get_ivar_slot(obj, id, false);
+		if (slot != -1) {
+		    val = rb_vm_get_ivar_from_slot(obj, slot);
+		    if (val != Qundef) {
+			rb_vm_set_ivar_from_slot(obj, Qundef, slot);
+			return val;
+		    }
+		}
+	    }
 	    break;
 
 	case T_CLASS:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100720/a939d2d1/attachment.html>


More information about the macruby-changes mailing list