Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
# At present, @tuple.kind_of?(Tuple) is essentially an invariant for Array. # If we relax this and ensure that every method behaves correctly if # @tuple == nil, then we can omit initializing @tuple here. We cannot # easily know whether #initialize is defined in a subclass when this # method is called. def self.allocate ary = super ary.instance_eval do @start = 0 @total = 0 @tuple = Tuple.new 8 end ary end
From the Design Piracy series on my blog: