Simple extension question

Discussion in 'Ruby' started by Mark Probert, Mar 10, 2005.

  1. Mark Probert

    Mark Probert Guest

    Hi ..

    What is the easy way of clearing an array in an extension?

    ie Given

    VALUE t_init(VALUE self)
    {
    VALUE foo;

    foo = rb_ary_new();
    rb_iv_set(self, "@foo", foo);
    }

    How do I do the equivalent of "foo.clear" ?

    Thanks,

    --
    -mark. (probertm at acm dot org)
     
    Mark Probert, Mar 10, 2005
    #1
    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. Anand
    Replies:
    3
    Views:
    919
    Tim Daneliuk
    Nov 8, 2003
  2. Christian Seberino
    Replies:
    3
    Views:
    1,220
    Christian Seberino
    Feb 5, 2004
  3. Steve
    Replies:
    3
    Views:
    27,104
    Steve
    Aug 25, 2006
  4. Elhanan
    Replies:
    0
    Views:
    564
    Elhanan
    Jan 23, 2007
  5. llothar
    Replies:
    17
    Views:
    1,276
    Steve Holden
    Apr 7, 2008
Loading...

Share This Page