James Edward Gray II wrote: > On Jul 13, 2007, at 1:02 AM, Charles Oliver Nutter wrote: > >> 2. Because many of these methods manipulate normally-inaccessible >> runtime state, it is not possible to implement them in Ruby code. >> Therefore, even if someone wanted to override them (the primary reason >> for them to be methods) they could not duplicate their behavior in the >> overridden version. Overriding only destroys their utility. > > You could override them to add behavior to them though, right? > > For example, you could make a custom version of eval() that makes some > change to the code before it runs it (using the overriden > implementation, of course). This change would then be picked up by all > code running eval(), I think. But you can't. alias :my_eval :eval def eval(x) puts 'here' my_eval(x) end a = 1 eval("puts a") # => error...the eval eventually runs under the overridden version, where no "a" variable exists. All the methods provided have this issue. - Charlie