Open Struct objects seem to rely on the message frozen? to determine if they 
are frozen.
----------------------------------------------------------------------------------------

                 Key: JRUBY-3445
                 URL: http://jira.codehaus.org/browse/JRUBY-3445
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.2
         Environment: Linux siena 2.6.27-11-generic #1 SMP Thu Jan 29 19:24:39 
UTC 2009 i686 GNU/Linux
jruby 1.2.0RC1 (ruby 1.8.6 patchlevel 287) (2009-02-25 rev 6586) [i386-java]

            Reporter: Robert Dober
            Priority: Minor
         Attachments: ostructfrozen.rb

510/13 > jruby -r ostruct -ve 'o=OpenStruct::new( :a => 42 ); class << o ; def 
frozen?; 42 < 0 end end;o.freeze; o.a=1764; p o.a'
jruby 1.2.0RC1 (ruby 1.8.6 patchlevel 287) (2009-02-25 rev 6586) [i386-java]
1764

It seems that JRuby's ostruct is not CRuby's ostruct and as the Ruby team 
rejected Joël's excellent proposal it is broken now :(.
Joël's proposal was to delegate to the underlying table object. If that might 
cause a problem one could still use a delegate object to freeze which should be 
altered on each modification of the ostruct. But I guess that such 
sophisticated nonsense is not necessary.
Sorry if this is not a JRuby issue.

Kind regards
Robert

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to