summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-21 07:28:54 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-21 07:28:54 +0000
commitda99e407fbf36051bf9ebce01418589bff557298 (patch)
tree2d673dc5133830cc910ac4e05106236659ff1658 /object.c
parent6228cbe5efb35f3fb867f42525905cf2ded37aad (diff)
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
Diffstat (limited to 'object.c')
-rw-r--r--object.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/object.c b/object.c
index a1947b2..355d1e4 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 <code>false</code> is the only instance of class
+ * <code>FalseClass</code> and represents a logically false value in
+ * boolean expressions. The class provides operators allowing
+ * <code>false</code> 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 <code>false</code>. <i>obj</i> 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 <code>false</code> if <i>obj</i> is
+ * <code>nil</code> or <code>false</code>; <code>true</code> 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 <i>obj</i> is <code>nil</code> or
+ * <code>false</code>, returns <code>false</code>; otherwise, returns
+ * <code>true</code>.
+ *
+ */
+
static VALUE
false_xor(obj, obj2)
VALUE obj, obj2;