From: Ken Bloom Date: 2008-01-23T01:09:59+09:00 Subject: Bugs in Facets Cloneable? I was just looking at the Cloneable module from the Facets' library, because it's useful, and noticed a couple of possible bugs. Is my assessment of this correct? module Cloneable def clone sibling = self.class.new instance_variables.each do |ivar| value = self.instance_variable_get(ivar) sibling.instance_variable_set(ivar, value.dup) #rake_dup) end sibling end alias_method :dup, :clone end Question 1: Shouldn't #clone use self.class.allocate instead of self.class.new? Better yet, shouldn't the superclass's dup be called somehow? Question 2: Shouldn't #clone and #dup be implemented differently, so that #clone can freeze the newly created object? --Ken -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/