passing Proc as a parameter

Discussion in 'Ruby' started by Can Ceran, Dec 13, 2006.

  1. Can Ceran

    Can Ceran Guest

    Hi,
    I'm a new user of Ruby, and trying to learn its features. But I have a
    difficulty to understand Proc class.
    What will be the referencing environment when we pass Proc as a
    parameter?
    and other question, how can we pass Proc as a parameter, can you give an
    example of it?
    Thanks for your help.

    --
    Posted via http://www.ruby-forum.com/.
    Can Ceran, Dec 13, 2006
    #1
    1. Advertising

  2. Pretty good explanation at this blog:

    http://eli.thegreenplace.net/2006/04/18/understanding-ruby-blocks-procs-and-methods

    On 12/12/06, Can Ceran <> wrote:
    > Hi,
    > I'm a new user of Ruby, and trying to learn its features. But I have a
    > difficulty to understand Proc class.
    > What will be the referencing environment when we pass Proc as a
    > parameter?
    > and other question, how can we pass Proc as a parameter, can you give an
    > example of it?
    > Thanks for your help.
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >



    --
    Giles Bowkett
    http://www.gilesgoatboy.org
    http://gilesbowkett.blogspot.com
    http://gilesgoatboy.blogspot.com
    Giles Bowkett, Dec 13, 2006
    #2
    1. Advertising

  3. Can Ceran

    Can Ceran Guest

    Can Ceran, Dec 13, 2006
    #3
  4. On Dec 12, 2006, at 6:00 PM, Can Ceran wrote:

    > Hi,
    > I'm a new user of Ruby, and trying to learn its features. But I have a
    > difficulty to understand Proc class.
    > What will be the referencing environment when we pass Proc as a
    > parameter?
    > and other question, how can we pass Proc as a parameter, can you
    > give an
    > example of it?


    This article might be worth a read:

    http://blog.grayproductions.net/articles/2006/01/05/code-as-a-data-type

    James Edward Gray II
    James Edward Gray II, Dec 13, 2006
    #4
    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. David Lozzi
    Replies:
    3
    Views:
    1,928
    David Lozzi
    Jun 1, 2005
  2. NevilleDNZ
    Replies:
    9
    Views:
    439
    NevilleDNZ
    Aug 16, 2006
  3. jcpc
    Replies:
    2
    Views:
    1,465
  4. Jean-Hugues ROBERT

    Why no Proc##[]=() ? Why no Proc##replace() ?

    Jean-Hugues ROBERT, May 1, 2004, in forum: Ruby
    Replies:
    14
    Views:
    280
    Jean-Hugues ROBERT
    May 5, 2004
  5. Minkoo Seo

    Proc vs lambda vs proc

    Minkoo Seo, Feb 4, 2007, in forum: Ruby
    Replies:
    19
    Views:
    239
    Brian Candler
    Feb 6, 2007
Loading...

Share This Page