2

在鲁比尼乌斯,如果你这样做

rbx-head > Object.instance_methods.grep(/^_.*/)
 => ["__extend__", "__show__", "__marshal__", "__instance_of__", "__instance_variable_get__", "__send__", "__id__", "__instance_variable_set__", "__respond_to_eh__", "__instance_variables__", "__class__", "__kind_of__", "__instance_variable_defined_eh__", "__nil__", "__metaclass__", "__fixnum__", "__method__"] 

其中包括"__respond_to_eh__""__instance_variable_defined_eh__"

所以这是因为 Rubinius 人想要包装不应该与 混淆的方法名称__,并且不允许?在方法名称的结尾之前使用,是吗?

4

1 回答 1

0

根据他们的评论,他们现在已经改为使用__instance_variable_defined_p__和在谓词中,就像其他地方一样。__respond_to_p__

嗯。

于 2011-01-20T20:21:01.517 回答