From: Yaser Sulaiman Date: 2010-06-25T22:30:09+09:00 Subject: Re: [QUIZ] Random Points within a Circle (#234) --0016368e2acef325e50489dac4b0 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jun 25, 2010 at 1:57 PM, Benoit Daloze wrote: > Cool, but I believe your implementation of Point#+ is somehow bad, > because it returns @y. > So you probably want to return self if you accept the Point objects to > be mutable, > or create a new Point, which is a bit safer, but creates a new object > (in both cases you could definitely get rid of this awful "return p" :) ) > > The _awful_ "return p" is now gone ;) I want Point objects to be mutable, so Point#+ returns self after modifying the x and y coordinates. > Also, @@origin should not be modified, and then should be a constant, > and be #freeze if you want Point to be mutable. Good point. The origin is now a "frozen" class constant. --0016368e2acef325e50489dac4b0--