Re: Ruby documentation typo



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


Relevant Pages

  • Re: Why are "Array#push" and "pop" not "push!" and "pop!"?
    ... On Tue, 4 Dec 2007, John Joyce wrote: ... Since we don't have immutable containers in Ruby, ... Upcoming training by David A. Black/Ruby Power and Light, ...
    (comp.lang.ruby)
  • Re: Function def at end of scripts
    ... call any sane person might enjoy reading the 'help' method first. ... overriding principle of my 'main.rb' lib and i think most people would agree ... David A. Black / Ruby Power and Light, ...
    (comp.lang.ruby)
  • Re: ABC Family renews "10 Things," cancels "Rockits"
    ... On Sep 11, 7:21 pm, David wrote: ... 'Ruby & the Rockits' will not be renewed ... additional episodes from the sitcom starring Alexa Vega and David and ...
    (rec.arts.tv)
  • Re: Twelve rules of Ruby
    ... Twelve Rules for Ruby. ... experiences learning and using Ruby: ... Every instance variable you ever see in any Ruby program belongs to ... Very interesting David. ...
    (comp.lang.ruby)
  • Re: using until
    ... I wasn't sure which issue was the focus (see my response to Lloyd ... begin/end one specifically as a way of forcing at least one execution ... since it was changed by Ruby ... David A. Black and Erik Kastner ...
    (comp.lang.ruby)