mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8812fe1a97
commit
ab142b7274
3 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
Sun May 10 11:13:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sun May 10 11:36:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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 @@ Sun May 10 11:13:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||
* 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@dotrb.org>
|
||||
|
||||
* lib/date.rb: use subsec instead of nsec.
|
||||
|
|
|
@ -95,6 +95,10 @@ module DL
|
|||
end
|
||||
end
|
||||
|
||||
def bound?()
|
||||
@cfunc.ptr != 0
|
||||
end
|
||||
|
||||
def bind_at_call(&block)
|
||||
bind(&block)
|
||||
end
|
||||
|
|
|
@ -63,6 +63,8 @@ module DL
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue