From: Brian Candler Date: 2010-09-03T22:21:36+09:00 Subject: Re: p vs. print Abder-Rahman Ali wrote: > This is the output I got from running your script: > > > C:\Users\Abder-Rahman\Desktop\Research>ruby p_vs_print_vs_puts.rb > here's a stringhere's a string > # > > Can you just describe this part: # That's what Object#inspect returns: a string containing the class name, the pointer to the object instance in memory, and the values of all instance variables. Other classes inherit this from Object, although they can override it if they wish. > And, when you said: "p(x) is like puts(x.inspect), [[where x converts an > object]] into a debugging string form, that is, one which shows its > internal state." > > Shouldn't "... where x converts an object...]], be "... where "inspect" > converts an object..."? Yes, my mistake. -- Posted via http://www.ruby-forum.com/.