klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

Equivalence.html (2743B)


      1 <html lang="en">
      2 <head>
      3 <title>Equivalence - klisp Reference Manual</title>
      4 <meta http-equiv="Content-Type" content="text/html">
      5 <meta name="description" content="klisp Reference Manual">
      6 <meta name="generator" content="makeinfo 4.13">
      7 <link title="Top" rel="start" href="index.html#Top">
      8 <link rel="prev" href="Booleans.html#Booleans" title="Booleans">
      9 <link rel="next" href="Symbols.html#Symbols" title="Symbols">
     10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
     11 <meta http-equiv="Content-Style-Type" content="text/css">
     12 <style type="text/css"><!--
     13   pre.display { font-family:inherit }
     14   pre.format  { font-family:inherit }
     15   pre.smalldisplay { font-family:inherit; font-size:smaller }
     16   pre.smallformat  { font-family:inherit; font-size:smaller }
     17   pre.smallexample { font-size:smaller }
     18   pre.smalllisp    { font-size:smaller }
     19   span.sc    { font-variant:small-caps }
     20   span.roman { font-family:serif; font-weight:normal; } 
     21   span.sansserif { font-family:sans-serif; font-weight:normal; } 
     22 --></style>
     23 <link rel="stylesheet" type="text/css" href="css/style.css">
     24 </head>
     25 <body>
     26 <div class="node">
     27 <a name="Equivalence"></a>
     28 <p>
     29 Next:&nbsp;<a rel="next" accesskey="n" href="Symbols.html#Symbols">Symbols</a>,
     30 Previous:&nbsp;<a rel="previous" accesskey="p" href="Booleans.html#Booleans">Booleans</a>,
     31 Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
     32 <hr>
     33 </div>
     34 
     35 <!-- node-name,  next,  previous,  up -->
     36 <h2 class="chapter">4 Equivalence</h2>
     37 
     38 <p><a name="index-equivalence-20"></a>
     39   Kernel has two general-purpose equivalence predicates (whereas R5RS
     40 Scheme has three).  The two Kernel predicates correspond to the
     41 abstract notions of equivalence up to mutation (<code>equal</code>) and
     42 equivalence in the presence of mutation (<code>eq?</code>).
     43 
     44 <div class="defun">
     45 &mdash; Applicative: <b>eq?</b> (<var>eq? . objects</var>)<var><a name="index-eq_003f-21"></a></var><br>
     46 <blockquote><p>  Predicate <code>eq?</code> returns true iff all of <code>objects</code> are
     47 effectively the same object, even in the presence of mutation. 
     48 <!-- todo maybe add more content here, specific to klisp -->
     49 </p></blockquote></div>
     50 
     51 <div class="defun">
     52 &mdash; Applicative: <b>equal?</b> (<var>equal? . objects</var>)<var><a name="index-equal_003f-22"></a></var><br>
     53 <blockquote><p>  Predicate <code>equal?</code> returns true iff all of <code>objects</code>
     54 &ldquo;look&rdquo; the same as long as nothing is mutated.  This is a weaker
     55 predicate than <code>eq?</code>; that is, <code>equal?</code> must return true
     56 whenever <code>eq?</code> would return true. 
     57 <!-- todo maybe add more content here, specific to klisp -->
     58 </p></blockquote></div>
     59 
     60 <!-- *-texinfo-*- -->
     61    </body></html>
     62