From: Robert Klemme Date: 2004-03-08T03:39:40+09:00 Subject: Re: freeze, frozen? in extensions "ts" schrieb im Newsbeitrag news:200403071546.i27FkgK20961@moulon.inra.fr... > >>>>> "T" == Tim Hunter writes: > > T> Today I see that I my original post was terse to the point of being > T> incomprehensible. What I was trying to ask was "How do I support the > T> freeze method in my C extension? That is, suppose a script calls the > T> freeze method on one of my objects, and then uses a method that modifies > T> that object. What should I do?" > > raise an error. > > T> To confirm my plan I started looking at the code for the standard > T> libraries that are written in C, but I saw very few calls to > T> rb_check_frozen. This makes me wonder, have I misunderstood how to support > T> frozen objects in C? > > No, but like said previously by "daz" , in many > case a C extension will use the standard API function and ruby will make > the test. Wouldn't it be more precise to say that those standard API methods will make the test? I mean, the interpreter won't know which methods are "const" and which aren't, but those methods will know. Just my 0.02 EUR... robert