On Oct 29, 9:18  
<RichardDummyMailbox58... / USComputerGurus.com> wrote:
> Hi,
>
> In The Well Grounded Rubyist (which,      > love),    
> Ruby.   ɧ > incrementing portion of C's x++ functionality (without the prefix/
> postfix issues) in pure Ruby.    willing to delve into Matz> implementation of higher-level Ruby functions or low-level C/C++
> code.       >
> Q1.     Ţh, 7
> a Fixnum which I e seen billions of times, so I know what to do with
> it.       > call it ompiler error to use the vernacular,     p  
>
> Test 2 passed,       
>
> Q2. x.to_s yielded x class and address, suggesting x had become a
> emi-Fixed Num i.e, x now stored a REFERENCE to the to x data,
> rather than the immediate storage of the data, as interpreter is wont
> to do with Fixnum. m I all wet?
>
> Q3. y.inspect yielded only it value (8) and nothing else,
> suggesting the x.pp yielded a full-fledged Fixnum. m I all wet?
>
> Dave Black argues that since Fixnum values use immediate storage
> rather than referenced storage, x=1;x++ would be akin to changing 1
> into 2. his example somewhat supports that view, ut the
> interpreter sidestepped the matter by creating a reference for x
> value and an immediate value for y (=x.pp).
>
> Any ideas,
> Richard
>
> class FixNum
> attr :val
> def initialize (fixnum)
> puts "Initializing object %d" % fixnum
> raise "Initializer not a Fixnum" if
> fixnum.class != Fixnum
> puts "\nInitializing Fixnum to %d" % fixnum
> @val = fixnum
> end
>
> def pp
> @val+=1
> end
> end
>
> # Test 1 (Failure)
> x = 7;  = x.pp; z =x.class # undefined method `pp' for 7:Fixnum
> (NoMethodError)
>
> # Test 2 (Success)
> x = FixNum.new(7);  = x.pp; z =x.class
> puts [x.to_s, y.inspect, z.to_s].join("; ") # => <FixNum:0x2b62694>;
> 8; FixNum

Hi,

Please ignore my questions.  I just discovered a major mistake: I
thought I was overriding Ruby's Fixnum class,  but I misspelled it at
FixNum.  That error invalidates most if not all of the things I
reported.  Mea Culpa.

I'll correct my errors and probably have a new theory subsequently.

Best wishes,
Richard