From: Brian Wisti Date: 2002-11-26T15:04:09+09:00 Subject: Re: Difference between puts and print --=====================_54600150==.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed At 02:54 PM 11/26/2002 +0900, you wrote: > > Method Names | How they work > > ------------------------------------------------------------ > > #print | using the #to_s on each item within > > | the presented 'string', and appends a > > | 'space' character after the concatonated > > | strings (and the space can get redirected > > | to another character) - irb seemed to not > > | put spaces, but I havent tested it with > > | the actual ruby interpreter... > >I did test it with the interpreter. print does *not* put spaces by >default. This is the behaviour I would expect. I only expect the "space-adding" behavior in Python. Most other languages that I've used won't insert spaces where you don't ask for them with a "print". Then again, I haven't used that many languages, so maybe I don't know what the expected behavior should be :-) -Brian W Brian Wisti brian@coolnamehere.com http://coolnamehere.com/ --=====================_54600150==.ALT Content-Type: text/html; charset="us-ascii" At 02:54 PM 11/26/2002 +0900, you wrote:
> Method Names  | How they work
> ------------------------------------------------------------
> #print                        | using the #to_s on each item within
>                               | the presented 'string', and appends a
>                               | 'space' character after the concatonated
>                               | strings (and the space can get redirected
>                               | to another character) - irb seemed to not
>                               | put spaces, but I havent tested it with
>                               | the actual ruby interpreter...

I did test it with the interpreter.  print does *not* put spaces by
default.  This is the behaviour I would expect.

I only expect the "space-adding" behavior in Python.  Most other languages that I've used won't insert spaces where you don't ask for them with a "print".  Then again, I haven't used that many languages, so maybe I don't know what the expected behavior should be :-)

-Brian W

Brian Wisti
brian@coolnamehere.com
http://coolnamehere.com/
--=====================_54600150==.ALT--