[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6683] Re: printing/accessing arrays and hashes

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-11-30 20:11:34 UTC
List: ruby-talk #6683
On Fri, 1 Dec 2000, Raja S. wrote:

> 
> These are just a snap shot of my "huh? -> aha!" transition as I learn more
> about the ruby way of thinking.  
> 
> Raja
	[...]
> ---------------------------------------------------------------------------
> 
> Quirk:    Printing hash literals as the first argument to print causes
>           syntax problems: 
> 
>           print {'a'=>1, 'b'=>2}
> 
> Fix:      Precede by an empty string.
>           print "", {'a'=>1, 'b'=>2}

or put brackets around it:
irb(main):001:0> print ( { "a" => "b" } )
abnil

> ---------------------------------------------------------------------------
> 
> Problem:  Default printing behavior (i.e., #to_s) of arrays/hashes doesn't
>           show structure
> 
> Fix:      Using #inspect
	[...] 
> Comment:  irb shows the structure when evaluating arrays/hashes
> 
>           Shouldn't this be the default printing behavior of ruby?  i.e.,
>           shouldn't the default #to_s of arrays and hashes show their
>           structure?

I think not.  You can read in a load of lines from a file into
an array.  Then later you can print them all out at once without
an interator.  

	Hugh



In This Thread