From da99e407fbf36051bf9ebce01418589bff557298 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 21 Dec 2003 07:28:54 +0000 Subject: Add file.c comments (and necessary support in parse_c.rb) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index a1947b2b55..355d1e4f61 100644 --- a/object.c +++ b/object.c @@ -476,6 +476,24 @@ true_xor(obj, obj2) return RTEST(obj2)?Qfalse:Qtrue; } + +/* + * Document-class: FalseClass + * + * The global value false is the only instance of class + * FalseClass and represents a logically false value in + * boolean expressions. The class provides operators allowing + * false to participate correctly in logical expressions. + * + */ + +/* + * call-seq: + * false.to_s => "false" + * + * 'nuf said... + */ + static VALUE false_to_s(obj) VALUE obj; @@ -483,6 +501,15 @@ false_to_s(obj) return rb_str_new2("false"); } +/* + * call-seq: + * false & obj => false + * + * And---Returns false. obj is always + * evaluated as it is the argument to a method call---there is no + * short-circuit evaluation in this case. + */ + static VALUE false_and(obj, obj2) VALUE obj, obj2; @@ -490,6 +517,15 @@ false_and(obj, obj2) return Qfalse; } + +/* + * call-seq: + * false | obj => true or false + * + * Or---Returns false if obj is + * nil or false; true otherwise. + */ + static VALUE false_or(obj, obj2) VALUE obj, obj2; @@ -497,6 +533,18 @@ false_or(obj, obj2) return RTEST(obj2)?Qtrue:Qfalse; } + + +/* + * call-seq: + * false ^ obj => true or false + * + * Exclusive Or---If obj is nil or + * false, returns false; otherwise, returns + * true. + * + */ + static VALUE false_xor(obj, obj2) VALUE obj, obj2; -- cgit v1.2.3