Re: Ruby documentation typo
- From: Behrang Saeedzadeh <behrangsa@xxxxxxxxx>
- Date: Wed, 31 Aug 2005 21:22:08 +0900
Hi David,
Thanks for the information. Actually I'm new to Ruby, and I've not passed
that page yet so...
Best Regards,
Behrang S.
On 8/31/05, David A. Black <dblack@xxxxxxxxxxxx> wrote:
>
> Hi --
>
> On Wed, 31 Aug 2005, Behrang Saeedzadeh wrote:
>
> > Hi all
> >
> > I just stumbled upon a typo in the Ruby documentation and thought it
> > would be OK to mention it here.
> >
> > The typo is at the http://www.rubycentral.com/book/intro.html page:
> >
> > ---
> > Sometimes creating arrays of words can be a pain, what with all the
> > quotes and commas. Fortunately, there's a shortcut: %w does just what
> > we want.
> >
> > a = %w{ ant bee cat dog elk }
> > ---
> >
> > I guess, the %w{ ant bee cat dog talk } must be %w[ ant bee cat dog
> > talk] as we're talking about arrays and not hashes.
>
> Actually %w can take just about any delimiter:
>
> %w-a b c-
> %w!a b c!
>
> etc. So you can definitely use {}.
>
>
> David
>
> --
> David A. Black
> dblack@xxxxxxxxxxxx
>
>
--
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
- Follow-Ups:
- Re: Ruby documentation typo
- From: James Britt
- Re: Ruby documentation typo
- From: Nikolai Weibull
- Re: Ruby documentation typo
- References:
- Ruby documentation typo
- From: Behrang Saeedzadeh
- Re: Ruby documentation typo
- From: David A. Black
- Ruby documentation typo
- Prev by Date: Re: Ruby documentation typo
- Next by Date: Re: Ruby documentation typo
- Previous by thread: Re: Ruby documentation typo
- Next by thread: Re: Ruby documentation typo
- Index(es):
Relevant Pages
|