Advanced Ruby Programming

Discussion in 'Ruby' started by Xiangrong Fang, Aug 28, 2003.

  1. Hi,

    I have been using ruby for awhile, but I still know very little about it
    :(.

    Today I read the uri.rb file because I need to port a piece of Java code
    to ruby. I found that I cannot understand uri.rb at all!

    1. what is the use of nested modules? i.e., why?

    2. What is the meaning of the following code? especially the "(?:" and
    "(?# 1:"?

    (#{PATTERN::SCHEME}): (?# 1: scheme)
    (?:
    (#{PATTERN::OPAQUE_PART}) (?# 2: opaque)

    Could any expert here point me to the right direction? Where can I find
    a book or online resource that explain these advanced topics?

    Thanks a lot.

    Sincerely,
    Shannon
     
    Xiangrong Fang, Aug 28, 2003
    #1
    1. Advertising

  2. Oh, that's part of a regexp? Thanks a lot :)

    Shannon

    On Thu, 28 Aug 2003 22:08:51 +0900
    Iain Truskett <> wrote:

    > * Xiangrong Fang () [28 Aug 2003 22:49]:
    >
    > [...]
    > > 1. what is the use of nested modules? i.e., why?

    >
    > Separation of code?
    >
    > > 2. What is the meaning of the following code? especially
    > > the "(?:" and "(?# 1:"?

    >
    > > (#{PATTERN::SCHEME}): (?# 1: scheme)
    > > (?:
    > > (#{PATTERN::OPAQUE_PART}) (?# 2: opaque)

    >
    > (?:...) and (?#...) are documented in the pickaxe.
    >
    > Respectively they are 'cluster' (group without capturing),
    > and 'embedded comment'.
    >
    >
    > cheers,
    > --
    > Iain.
    >


    --
    Xiangrong Fang <>
     
    Xiangrong Fang, Aug 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Matthews
    Replies:
    4
    Views:
    765
    Agent Mulder
    Aug 27, 2003
  2. chellappa

    advanced c programming

    chellappa, Jul 7, 2005, in forum: C Programming
    Replies:
    1
    Views:
    348
    Richard Bos
    Jul 7, 2005
  3. Replies:
    2
    Views:
    523
    Skarmander
    Oct 20, 2005
  4. Michele Simionato
    Replies:
    1
    Views:
    611
    Lacrima
    Mar 27, 2010
  5. pat eyler
    Replies:
    6
    Views:
    138
    Garance A Drosehn
    Dec 21, 2005
Loading...

Share This Page