From: Tristin Davis Date: 2008-07-03T21:48:55+09:00 Subject: Ruby C API Question ------=_Part_8809_18055875.1215089516672 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I've been going over the Ruby API and I have a couple questions. Why are the variables defined outside the block? What effect does this have on the variables? static VALUE fsdbm_s_open(argc, argv, klass) int argc; VALUE *argv; VALUE klass; { VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0); if (NIL_P(fsdbm_initialize(argc, argv, obj))) { return Qnil; } if (rb_block_given_p()) { return rb_ensure(rb_yield, obj, fsdbm_close, obj); } return obj; } I've always defined my variables inside a block. static VALUE fsdbm_s_open(argc,argv,self) { int argc; VALUE *argv; VALUE self /* Etc */ } ------=_Part_8809_18055875.1215089516672--