[前][次][番号順一覧][スレッド一覧]

ruby-changes:11740

From: nobu <ko1@a...>
Date: Sun, 10 May 2009 11:37:15 +0900 (JST)
Subject: [ruby-changes:11740] Ruby:r23386 (trunk): * ext/dl/lib/dl/func.rb (DL::Function#bound?): returns if already

nobu	2009-05-10 11:36:13 +0900 (Sun, 10 May 2009)

  New Revision: 23386

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23386

  Log:
    * ext/dl/lib/dl/func.rb (DL::Function#bound?): returns if already
      bound to a block.
    * ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be
      given if arg is not bound.  [ruby-dev:38404]

  Modified files:
    trunk/ChangeLog
    trunk/ext/dl/lib/dl/func.rb
    trunk/ext/dl/lib/dl/value.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23385)
+++ ChangeLog	(revision 23386)
@@ -1,4 +1,4 @@
-Sun May 10 11:13:19 2009  Nobuyoshi Nakada  <nobu@r...>
+Sun May 10 11:36:11 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
 	  the argument is an instance of DL::CFunc.
@@ -9,6 +9,12 @@
 	* ext/dl/lib/dl/cparser.rb (DL::CParser#parse_signature): strips
 	  spaces.  based on a patch from Takashi Tamura in [ruby-dev:38398].
 
+	* ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be
+	  given if arg is not bound.  [ruby-dev:38404]
+
+	* ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
+	  the argument is an instance of DL::CFunc.
+
 Sat May  9 19:23:46 2009  Tadayoshi Funaba  <tadf@d...>
 
 	* lib/date.rb: use subsec instead of nsec.
Index: ext/dl/lib/dl/func.rb
===================================================================
--- ext/dl/lib/dl/func.rb	(revision 23385)
+++ ext/dl/lib/dl/func.rb	(revision 23386)
@@ -95,6 +95,10 @@
       end
     end
 
+    def bound?()
+      @cfunc.ptr != 0
+    end
+
     def bind_at_call(&block)
       bind(&block)
     end
Index: ext/dl/lib/dl/value.rb
===================================================================
--- ext/dl/lib/dl/value.rb	(revision 23385)
+++ ext/dl/lib/dl/value.rb	(revision 23386)
@@ -63,6 +63,8 @@
           if( block )
             arg.bind_at_call(&block)
             funcs.push(arg)
+          elsif !arg.bound?
+            raise(RuntimeError, "block must be given.")
           end
           return arg.to_i
         when String

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]