Jump to content

Boolean values: Difference between revisions

added common lisp, scheme
(added php)
(added common lisp, scheme)
Line 24:
* any pointer type, where the null pointer gives false and any other pointer gives true
* any user-defined type with an implicit conversion operator either to <code>bool</code> or to a built-in type which itself can be converted to <code>bool</code> (i.e. any of the above). The C++ standard library contains one such implicit conversion: the implicit conversion of a stream <code>s</code> to <code>bool</code> gives <code>!s.fail()</code>
 
=={{header|Common Lisp}}==
The only value in Common Lisp that is false is <tt>nil</tt>, the empty list.
 
Everything else is true. The constant <tt>t</tt> represents the canonical true value.
 
=={{header|E}}==
Line 158 ⟶ 163:
<code>false</code>, <code>nil</code> and <code>true</code> are singleton instances of classes <code>FalseClass</code>, <code>NilClass</code> and <code>TrueClass</code> respectively.
[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UF]
 
=={{header|Scheme}}==
The only value in Scheme that is false is <tt>#f</tt>.
 
Everything else (including the empty list, unlike Lisp) is true. The constant <tt>#t</tt> represents the canonical true value.
 
=={{header|Tcl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.