This code can behave differently in cases if it was optimized or not. Typeclass can be frozen, so we can make assumptions about it's functions. The problem concerns to infix functions.
Foo = Typeclass.new :a do
infix :foo, [:a]
end
class A
end
Foo.instance A do
def foo(this)
foo this # some recursion
end
end
class B < A
def foo
fail # some unexpected behavior
end
end
This code can behave differently in cases if it was optimized or not. Typeclass can be frozen, so we can make assumptions about it's functions. The problem concerns to infix functions.
http://www.sitepoint.com/rubys-important-hook-methods/ http://stackoverflow.com/questions/708642/how-to-make-a-base-class-method-non-overridable-in-ruby http://scie.nti.st/2008/9/17/making-methods-immutable-in-ruby/ http://stackoverflow.com/questions/2441524/closest-ruby-representation-of-a-private-static-final-and-public-static-final https://www.ruby-forum.com/topic/65458