1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<ppdoc>
<copyright>
Copyright (c) 2001 by Addison Wesley Longman. This
material may be distributed only subject to the terms and
conditions set forth in the Open Publication License, v1.0 or
later (the latest version is presently available at
http://www.opencontent.org/openpub/).
</copyright>
<class name="TrueClass" super="Object" type="class">
The global value <const>true</const> is the only instance of class
<classname>TrueClass</classname> and represents a logically true value in boolean
expressions. The class provides operators allowing <const>true</const>
to be used in logical expressions.
<p/>
<methods type="instance">
<method name="&" ref="_et">
<callseq>
<const>true</const> & <obj>anObject</obj>
<returns><obj>anObject</obj></returns>
</callseq>
<desc>
<p/>
And---Returns <const>false</const> if <obj>anObject</obj> is <tt>nil</tt> or
<const>false</const>, <const>true</const> otherwise.
<p/>
</desc>
</method>
<p/>
<method name="^" ref="_up">
<callseq>
<const>true</const> ^ <obj>anObject</obj>
<returns>!<obj>anObject</obj></returns>
</callseq>
<desc>
<p/>
Exclusive Or---Returns <const>true</const> if
<obj>anObject</obj> is <tt>nil</tt> or <const>false</const>,
<const>false</const> otherwise.
<p/>
</desc>
</method>
<p/>
<method name="|" ref="_ba">
<callseq>
<const>true</const> | <obj>anObject</obj>
<returns><const>true</const></returns>
</callseq>
<desc>
<p/>
Or---Returns <const>true</const>. As <obj>anObject</obj> is an
argument to a method call, it is always evaluated; there is no
short-circuit evaluation in this case.
<p/>
<codefragment>
<alltt><fullcode><![CDATA[ true | puts("or")
true || puts("logical or")
]]></fullcode>
true<nbsp/>|<nbsp/><nbsp/>puts("or")
true<nbsp/>||<nbsp/>puts("logical<nbsp/>or")
</alltt>
</codefragment>
<em>produces:</em>
<codefragment><alltt>
or
</alltt>
</codefragment>
<p/>
</desc>
</method>
<p/>
</methods>
<p/>
</class>
</ppdoc>
|