12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <html lang="en">
- <head>
- <title>Predicates - avram - a virtual machine code interpreter</title>
- <meta http-equiv="Content-Type" content="text/html">
- <meta name="description" content="avram - a virtual machine code interpreter">
- <meta name="generator" content="makeinfo 4.13">
- <link title="Top" rel="start" href="index.html#Top">
- <link rel="up" href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Virtual Code Semantics">
- <link rel="prev" href="Assignment.html#Assignment" title="Assignment">
- <link rel="next" href="Iteration.html#Iteration" title="Iteration">
- <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
- --></style>
- </head>
- <body>
- <div class="node">
- <a name="Predicates"></a>
- <p>
- Next: <a rel="next" accesskey="n" href="Iteration.html#Iteration">Iteration</a>,
- Previous: <a rel="previous" accesskey="p" href="Assignment.html#Assignment">Assignment</a>,
- Up: <a rel="up" accesskey="u" href="Virtual-Code-Semantics.html#Virtual-Code-Semantics">Virtual Code Semantics</a>
- <hr>
- </div>
- <h4 class="subsection">2.7.11 Predicates</h4>
- <p><a name="index-predicates-310"></a>A couple of operations are built into the virtual machine for performing
- tests efficiently. These functions return either <code>nil</code> for false or
- <code>(nil,nil)</code> for true, and are useful for example as a predicate
- <var>p</var> in programs of the form
- <code>conditional(</code><var>p</var><code>,(</code><var>f</var><code>,</code><var>g</var><code>))</code> among other things. In
- this example, the predicate is applied to the argument, a result of
- <code>(nil,nil)</code> causes <var>f</var> to be applied to it, and a result
- of <code>nil</code> causes <var>g</var> to be applied to it.
- <ul class="menu">
- <li><a accesskey="1" href="Compare.html#Compare">Compare</a>
- <li><a accesskey="2" href="Member.html#Member">Member</a>
- </ul>
- </body></html>
|