[MacRuby-devel] Problem with (Ruby) bindings

Michael Winterstein parzival at mindspring.com
Sat Nov 28 11:39:29 PST 2009


I'm not sure if this is a known bug, or related to any open issues with bindings, but I found this while messing around (using r3059):

# This works 
lv1 = 1
lv2 = 2
lv1_binding = lv1.send(:binding)
lv2_binding = lv2.send(:binding)


# This fails.
class A
lv1 = 1
lv2 = 2
lv1_binding = lv1.send(:binding)  # lv1_binding gets assigned OK
lv2_binding = lv2.send(:binding)  # This is what fails
end


Assertion failed: (bind != NULL), function rb_binding_new, file proc.c, line 228.
Abort trap


I haven't poked into it much as it's unlikely to see much use.  It might not be restricted to local variables, and I haven't had it fail by sending other methods (but I haven't tried many).


Michael




More information about the MacRuby-devel mailing list