Commit ce1a2864 authored by nasciiboy's avatar nasciiboy

¸.·´¯`·¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>

parent 7541c557
......@@ -1267,7 +1267,7 @@ Multiply NUMBER by seven.
<p>Here, the true-or-false-test is the expression:</p>
<pre class="code" ><code class="chroma" ><span class="p">(</span><span class="nf">equal</span> <span class="nv">characteristic</span> <span class="ss">&#39;fierce</span><span class="p">)</span>
</code></pre>
<p>In Lisp, <code>equal</code> is a function that determines whether its first argument is equal to its second argument. The second argument is the quoted symbol <code>&#39;fierce</code> and the first argument is the value of the symbol <code>characteristic</code>---in other words, the argument passed to this function.</p>
<p>In Lisp, <code>equal</code> is a function that determines whether its first argument is equal to its second argument. The second argument is the quoted symbol <code>&#39;fierce</code> and the first argument is the value of the symbol <code>characteristic</code>––in other words, the argument passed to this function.</p>
<p>In the first exercise of <code>type-of-animal</code>, the argument <code>fierce</code> is passed to <code>type-of-animal</code>. Since <code>fierce</code> is equal to <code>fierce</code>, the expression, <code>(equal characteristic &#39;fierce)</code>, returns a value of true. When this happens, the <code>if</code> evaluates the second argument or then-part of the <code>if</code>: <code>(message &#34;It&#39;s tiger!&#34;)</code>.</p>
<p>On the other hand, in the second exercise of <code>type-of-animal</code>, the argument <code>zebra</code> is passed to <code>type-of-animal</code>. <code>zebra</code> is not equal to <code>fierce</code>, so the then-part is not evaluated and <code>nil</code> is returned by the <code>if</code> expression.</p>
</div>
......@@ -1309,7 +1309,7 @@ Multiply NUMBER by seven.
<p>The expression that tests for truth is interpreted as <dfn>true</dfn> if the result of evaluating it is a value that is not <code>nil</code>. In other words, the result of the test is considered true if the value returned is a number such as 47, a string such as <code>&#34;hello&#34;</code>, or a symbol (other than <code>nil</code>) such as <code>flowers</code>, or a list (so long as it is not empty), or even a buffer!</p>
<p>Before illustrating a test for truth, we need an explanation of <code>nil</code>.</p>
<p>In Emacs Lisp, the symbol <code>nil</code> has two meanings. First, it means the empty list. Second, it means false and is the value returned when a true-or-false-test tests false. <code>nil</code> can be written as an empty list, <code>()</code>, or as <code>nil</code>. As far as the Lisp interpreter is concerned, <code>()</code> and <code>nil</code> are the same. Humans, however, tend to use <code>nil</code> for false and <code>()</code> for the empty list.</p>
<p>In Emacs Lisp, any value that is not <code>nil</code>---is not the empty list––is considered true. This means that if an evaluation returns something that is not an empty list, an <code>if</code> expression will test true. For example, if a number is put in the slot for the test, it will be evaluated and will return itself, since that is what numbers do when evaluated. In this conditional, the <code>if</code> expression will test true. The expression tests false only when <code>nil</code>, an empty list, is returned by evaluating the expression.</p>
<p>In Emacs Lisp, any value that is not <code>nil</code>––is not the empty list––is considered true. This means that if an evaluation returns something that is not an empty list, an <code>if</code> expression will test true. For example, if a number is put in the slot for the test, it will be evaluated and will return itself, since that is what numbers do when evaluated. In this conditional, the <code>if</code> expression will test true. The expression tests false only when <code>nil</code>, an empty list, is returned by evaluating the expression.</p>
<p>You can see this by evaluating the two expressions in the following examples.</p>
<p>In the first example, the number 4 is evaluated as the test in the <code>if</code> expression and returns itself; consequently, the then-part of the expression is evaluated and returned: ‘true’ appears in the echo area. In the second example, the <code>nil</code> indicates false; consequently, the else-part of the expression is evaluated and returned: ‘false’ appears in the echo area.</p>
<pre class="code" ><code class="chroma" ><span class="p">(</span><span class="nb">if</span> <span class="mi">4</span>
......@@ -1958,7 +1958,7 @@ Beginning of buffer is position (point-min), end is (point-max).
<span class="p">(</span><span class="nb">setq</span> <span class="nv">buffer</span> <span class="p">(</span><span class="nf">get-buffer</span> <span class="nv">buffer</span><span class="p">)))</span>
</code></pre>
<p>The first argument to <code>or</code> is the expression <code>(bufferp buffer)</code>. This expression returns true (a non-<code>nil</code> value) if the buffer is actually a buffer, and not just the name of a buffer. In the <code>or</code> expression, if this is the case, the <code>or</code> expression returns this true value and does not evaluate the next expression––and this is fine with us, since we do not want to do anything to the value of <code>buffer</code> if it really is a buffer.</p>
<p>On the other hand, if the value of <code>(bufferp buffer)</code> is <code>nil</code>, which it will be if the value of <code>buffer</code> is the name of a buffer, the Lisp interpreter evaluates the next element of the <code>or</code> expression. This is the expression <code>(setq buffer (get-buffer buffer))</code>. This expression returns a non-<code>nil</code> value, which is the value to which it sets the variable <code>buffer</code>---and this value is a buffer itself, not the name of a buffer.</p>
<p>On the other hand, if the value of <code>(bufferp buffer)</code> is <code>nil</code>, which it will be if the value of <code>buffer</code> is the name of a buffer, the Lisp interpreter evaluates the next element of the <code>or</code> expression. This is the expression <code>(setq buffer (get-buffer buffer))</code>. This expression returns a non-<code>nil</code> value, which is the value to which it sets the variable <code>buffer</code>––and this value is a buffer itself, not the name of a buffer.</p>
<p>The result of all this is that the symbol <code>buffer</code> is always bound to a buffer itself rather than to the name of a buffer. All this is necessary because the <code>set-buffer</code> function in a following line only works with a buffer itself, not with the name to a buffer.</p>
<p>Incidentally, using <code>or</code>, the situation with the usher would be written like this:</p>
<pre class="code" ><code class="chroma" ><span class="p">(</span><span class="nb">or</span> <span class="p">(</span><span class="nv">holding-on-to-guest</span><span class="p">)</span> <span class="p">(</span><span class="nv">find-and-take-arm-of-guest</span><span class="p">))</span>
......@@ -7901,7 +7901,7 @@ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
</div>
</div>
<div class="about" >
<div class="about-dt" ><span class="note" ><sup><a href="#16" >16</a></sup></span></div>
<div class="about-dt" ><span class="defnote" id="16" >16</span></div>
<div class="about-dd" >
<p>I also run more modern window managers, such as Enlightenment, Gnome, or KDE; in those cases, I often specify an image rather than a plain color.</p>
</div>
......
......@@ -2442,7 +2442,7 @@ promoting software freedom.”
In Lisp, @c{equal} is a function that determines whether its first
argument is equal to its second argument. The second argument is the
quoted symbol @c{'fierce} and the first argument is the value of the
symbol @c{characteristic}---in other words, the argument passed to this
symbol @c{characteristic}––in other words, the argument passed to this
function.
In the first exercise of @c{type-of-animal}, the argument @c{fierce} is
......@@ -2547,7 +2547,7 @@ promoting software freedom.”
@c{()} and @c{nil} are the same. Humans, however, tend to use @c{nil} for
false and @c{()} for the empty list.
In Emacs Lisp, any value that is not @c{nil}---is not the empty list––is
In Emacs Lisp, any value that is not @c{nil}––is not the empty list––is
considered true. This means that if an evaluation returns something that
is not an empty list, an @c{if} expression will test true. For example,
if a number is put in the slot for the test, it will be evaluated and will
......@@ -3882,7 +3882,7 @@ promoting software freedom.”
interpreter evaluates the next element of the @c{or} expression. This is
the expression @c{(setq buffer (get-buffer buffer))}. This expression
returns a non-@c{nil} value, which is the value to which it sets the
variable @c{buffer}---and this value is a buffer itself, not the name of
variable @c{buffer}––and this value is a buffer itself, not the name of
a buffer.
The result of all this is that the symbol @c{buffer} is always bound to a
......@@ -15807,6 +15807,6 @@ promoting software freedom.”
> emacs -Q -D
< srci..
:: @n{16} :: I also run more modern window managers, such as Enlightenment,
:: @N{16} :: I also run more modern window managers, such as Enlightenment,
Gnome, or KDE; in those cases, I often specify an image rather than a
plain color.
......@@ -506,7 +506,7 @@
</div>
<h4 id="gnu-emacs-te-ayuda-a-escribir-listas" >GNU Emacs te ayuda a escribir listas</h4>
<div class="hBody-4" >
<p>Cuando se escribe una expresión Lisp en GNU Emacs usando el modo de Interacción Lisp o el modo Emacs Lisp, están disponibles varios comandos para formatear la expresión Lisp, de modo que sea fácil de leer. Por ejemplo, presionando la tecla <kbd>TAB</kbd> automáticamente se indenta la línea donde se encuetra el cursor a la cantidad correcta. Un comando para indentar apropiadamente el código en una región suele vincularse a <kbd>M-C-\</kbd>. La indentación está diseñada de modo que se pueda ver qué elementos pertenecen a cada lista––los elementos de una sublista están más indentados que los elementos de la lista adjunta.</p>
<p>Cuando se escribe una expresión Lisp en GNU Emacs usando el modo de Interacción Lisp o el modo Emacs Lisp, están disponibles varios comandos para formatear la expresión Lisp, de modo que sea fácil de leer. Por ejemplo, presionando la tecla <kbd>TAB</kbd> automáticamente se indenta la línea donde se encuentra el cursor a la cantidad correcta. Un comando para indentar apropiadamente el código en una región suele vincularse a <kbd>M-C-\</kbd>. La indentación está diseñada de modo que se pueda ver qué elementos pertenecen a cada lista––los elementos de una sublista están más indentados que los elementos de la lista adjunta.</p>
<p>Además, al escribir un paréntesis de cierre, Emacs mueve el cursor momentáneamente hacia el parentesis de apertura correspondiente, para que puedas ver cual es. Esto es muy útil, ya que cada lista que escribas en Lisp debe tener su paréntesis de cierre que coincida con su paréntesis de apertura. (Consulta la Seccion <a href="emacs.html#Major-Modes" >Modos Mayores</a> en <em>El Manual de GNU Emacs</em>, para más información sobre los modos de Emacs.)</p>
</div>
<h3 id="ejecutar-un-programa" >Ejecutar un programa</h3>
......
......@@ -376,7 +376,7 @@ and promoting software freedom.”
Interacción Lisp o el modo Emacs Lisp, están disponibles varios comandos
para formatear la expresión Lisp, de modo que sea fácil de leer. Por
ejemplo, presionando la tecla @k{TAB} automáticamente se indenta la línea
donde se encuetra el cursor a la cantidad correcta. Un comando para indentar
donde se encuentra el cursor a la cantidad correcta. Un comando para indentar
apropiadamente el código en una región suele vincularse a @k{M-C-\}. La
indentación está diseñada de modo que se pueda ver qué elementos pertenecen a
cada lista––los elementos de una sublista están más indentados que los
......
......@@ -692,7 +692,7 @@ and promoting software freedom.”
Interacción Lisp o el modo Emacs Lisp, están disponibles varios comandos
para formatear la expresión Lisp, de modo que sea fácil de leer. Por
ejemplo, presionando la tecla @k{TAB} automáticamente se indenta la línea
donde se encuetra el cursor a la cantidad correcta. Un comando para indentar
donde se encuentra el cursor a la cantidad correcta. Un comando para indentar
apropiadamente el código en una región suele vincularse a @k{M-C-\}. La
indentación está diseñada de modo que se pueda ver qué elementos pertenecen a
cada lista––los elementos de una sublista están más indentados que los
......@@ -4403,7 +4403,7 @@ and promoting software freedom.”
# In Lisp, @c{equal} is a function that determines whether its first
# argument is equal to its second argument. The second argument is the
# quoted symbol @c{'fierce} and the first argument is the value of the
# symbol @c{characteristic}---in other words, the argument passed to this
# symbol @c{characteristic}––in other words, the argument passed to this
# function.
En Lisp, @c{equal} es una función que determina si su primer argumento es
igual al segundo. El segundo argumento es el símbolo citado @c{'fiero} y el
......@@ -4596,7 +4596,7 @@ and promoting software freedom.”
humanos, sin embargo, tienden a usar @c{nil} para falso y @c{()} para
lista vacía.
# In Emacs Lisp, any value that is not @c{nil}---is not the empty list––is
# In Emacs Lisp, any value that is not @c{nil}––is not the empty list––is
# considered true. This means that if an evaluation returns something that
# is not an empty list, an @c{if} expression will test true. For example,
# if a number is put in the slot for the test, it will be evaluated and will
......@@ -6953,7 +6953,7 @@ and promoting software freedom.”
# interpreter evaluates the next element of the @c{or} expression. This is
# the expression @c{(setq buffer (get-buffer buffer))}. This expression
# returns a non-@c{nil} value, which is the value to which it sets the
# variable @c{buffer}---and this value is a buffer itself, not the name of
# variable @c{buffer}––and this value is a buffer itself, not the name of
# a buffer.
Por otro lado, si el valor de @c{(bufferp buffer)} es @c{nil}, que lo sera
si el valor de @c{buffer} es el nombre de un buffer, el intérprete Lisp
......@@ -28286,7 +28286,7 @@ and promoting software freedom.”
> emacs -Q -D
< srci..
# :: @n{16} :: I also run more modern window managers, such as Enlightenment,
# :: @N{16} :: I also run more modern window managers, such as Enlightenment,
# Gnome, or KDE; in those cases, I often specify an image rather than a
# plain color.
:: @N{16} :: También ejecuto gestores de ventanas más modernos,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment