Še lepši izpis

main
Jurij Podgoršek 2024-04-21 17:36:07 +02:00
parent ff6a2c7240
commit 5b75f7e356
2 changed files with 105 additions and 80 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2024-04-21 ned 17:31 --> <!-- 2024-04-21 ned 17:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Zapiski #1 srečanja programerskega bralnega krožka SICP</title> <title>Zapiski #1 srečanja programerskega bralnega krožka SICP</title>
@ -198,13 +198,13 @@
<div id="content" class="content"> <div id="content" class="content">
<h1 class="title">Zapiski #1 srečanja programerskega bralnega krožka SICP</h1> <h1 class="title">Zapiski #1 srečanja programerskega bralnega krožka SICP</h1>
<div id="outline-container-orgdb45ffb" class="outline-2"> <div id="outline-container-org42dee3b" class="outline-2">
<h2 id="orgdb45ffb">Zanimivi izseki</h2> <h2 id="org42dee3b">Zanimivi izseki</h2>
<div class="outline-text-2" id="text-orgdb45ffb"> <div class="outline-text-2" id="text-org42dee3b">
</div> </div>
<div id="outline-container-orgdb3a94c" class="outline-3"> <div id="outline-container-orgdf32ea0" class="outline-3">
<h3 id="orgdb3a94c">str. 9</h3> <h3 id="orgdf32ea0">str. 9</h3>
<div class="outline-text-3" id="text-orgdb3a94c"> <div class="outline-text-3" id="text-orgdf32ea0">
<blockquote> <blockquote>
<p> <p>
Every reader should ask himself periodically "Toward what end, toward what end?" — but do not ask it too often lest you pass up the fun of programming for the constipation of bittersweet philosophy. Every reader should ask himself periodically "Toward what end, toward what end?" — but do not ask it too often lest you pass up the fun of programming for the constipation of bittersweet philosophy.
@ -218,9 +218,9 @@ Lisp is a survivor, having been in use for about a quarter of a century.
</blockquote> </blockquote>
</div> </div>
</div> </div>
<div id="outline-container-orgd838ad3" class="outline-3"> <div id="outline-container-org8373b18" class="outline-3">
<h3 id="orgd838ad3">str. 11</h3> <h3 id="org8373b18">str. 11</h3>
<div class="outline-text-3" id="text-orgd838ad3"> <div class="outline-text-3" id="text-org8373b18">
<blockquote> <blockquote>
<p> <p>
It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures. It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures.
@ -228,9 +228,9 @@ It is better to have 100 functions operate on one data structure than to have 10
</blockquote> </blockquote>
</div> </div>
</div> </div>
<div id="outline-container-orgff036a5" class="outline-3"> <div id="outline-container-org3dac309" class="outline-3">
<h3 id="orgff036a5">str. 18</h3> <h3 id="org3dac309">str. 18</h3>
<div class="outline-text-3" id="text-orgff036a5"> <div class="outline-text-3" id="text-org3dac309">
<blockquote> <blockquote>
<p> <p>
Thus, programs must be written for people to read, and only incidentally for machines to execute. Thus, programs must be written for people to read, and only incidentally for machines to execute.
@ -238,9 +238,9 @@ Thus, programs must be written for people to read, and only incidentally for mac
</blockquote> </blockquote>
</div> </div>
</div> </div>
<div id="outline-container-org0bcc7c3" class="outline-3"> <div id="outline-container-org7994660" class="outline-3">
<h3 id="org0bcc7c3">str. 19</h3> <h3 id="org7994660">str. 19</h3>
<div class="outline-text-3" id="text-org0bcc7c3"> <div class="outline-text-3" id="text-org7994660">
<blockquote> <blockquote>
<p> <p>
Underlying our approach to this subject is our conviction that "computer science" is not a science and that its significance has little to do with computers. Underlying our approach to this subject is our conviction that "computer science" is not a science and that its significance has little to do with computers.
@ -248,9 +248,9 @@ Underlying our approach to this subject is our conviction that "computer science
</blockquote> </blockquote>
</div> </div>
</div> </div>
<div id="outline-container-orgab12cbf" class="outline-3"> <div id="outline-container-org3d45fa2" class="outline-3">
<h3 id="orgab12cbf">str. 27</h3> <h3 id="org3d45fa2">str. 27</h3>
<div class="outline-text-3" id="text-orgab12cbf"> <div class="outline-text-3" id="text-org3d45fa2">
<blockquote> <blockquote>
<p> <p>
Finally, we would like to acknowledge the support of the organizations that have encouraged this work over the years, including support from Hewlett-Packard, made possible by Ira Goldstein and Joel Birnbaum, and support from DARPA, made possible by Bob Kahn. Finally, we would like to acknowledge the support of the organizations that have encouraged this work over the years, including support from Hewlett-Packard, made possible by Ira Goldstein and Joel Birnbaum, and support from DARPA, made possible by Bob Kahn.
@ -271,25 +271,25 @@ Preko očeta v sorodu s fizikom Hermanom Kahnom, ki je napisal knjigo o tem kako
</div> </div>
</div> </div>
<div id="outline-container-org8b3d153" class="outline-3"> <div id="outline-container-org0861788" class="outline-3">
<h3 id="org8b3d153">str. 77</h3> <h3 id="org0861788">str. 77</h3>
<div class="outline-text-3" id="text-org8b3d153"> <div class="outline-text-3" id="text-org0861788">
<p> <p>
Stoy 1977 Stoy 1977
</p> </p>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org784a7af" class="outline-2"> <div id="outline-container-orgfcfaeb8" class="outline-2">
<h2 id="org784a7af">Vaje</h2> <h2 id="orgfcfaeb8">Vaje</h2>
<div class="outline-text-2" id="text-org784a7af"> <div class="outline-text-2" id="text-orgfcfaeb8">
</div> </div>
<div id="outline-container-orgfd9bfc3" class="outline-3"> <div id="outline-container-org9ddb5fa" class="outline-3">
<h3 id="orgfd9bfc3">1.1 Kaj vrnejo izrazi?</h3> <h3 id="org9ddb5fa">1.1 Kaj vrnejo izrazi?</h3>
</div> </div>
<div id="outline-container-orgc168141" class="outline-3"> <div id="outline-container-org77dfe73" class="outline-3">
<h3 id="orgc168141">1.2 Pretvori izraz v prefix obliko</h3> <h3 id="org77dfe73">1.2 Pretvori izraz v prefix obliko</h3>
<div class="outline-text-3" id="text-orgc168141"> <div class="outline-text-3" id="text-org77dfe73">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-scheme"><span style="color: #458588;">(</span>/ <span style="color: #b16286;">(</span>+ 5 4 <pre class="src src-scheme"><span style="color: #458588;">(</span>/ <span style="color: #b16286;">(</span>+ 5 4
<span style="color: #8ec07c;">(</span>- 2 <span style="color: #8ec07c;">(</span>- 2
@ -307,9 +307,9 @@ Stoy 1977
</pre> </pre>
</div> </div>
</div> </div>
<div id="outline-container-orgfb17545" class="outline-3"> <div id="outline-container-org30e4913" class="outline-3">
<h3 id="orgfb17545">1.3 procedura, ki prejme 3 argumente in vrne vsoto kvadratov vecjih dveh</h3> <h3 id="org30e4913">1.3 procedura, ki prejme 3 argumente in vrne vsoto kvadratov vecjih dveh</h3>
<div class="outline-text-3" id="text-orgfb17545"> <div class="outline-text-3" id="text-org30e4913">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-scheme"><span style="color: #458588;">(</span><span style="color: #fb4933;">define</span> <span style="color: #b16286;">(</span><span style="color: #fabd2f;">vsota-vecjih-kvadratov</span> a b c<span style="color: #b16286;">)</span> <pre class="src src-scheme"><span style="color: #458588;">(</span><span style="color: #fb4933;">define</span> <span style="color: #b16286;">(</span><span style="color: #fabd2f;">vsota-vecjih-kvadratov</span> a b c<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">cond</span> <span style="color: #8ec07c;">(</span><span style="color: #d65d0e;">(</span>&lt;= a b c<span style="color: #d65d0e;">)</span> <span style="color: #d65d0e;">(</span>+ <span style="color: #458588;">(</span>* b b<span style="color: #458588;">)</span> <span style="color: #458588;">(</span>* c c<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span> <span style="color: #b16286;">(</span><span style="color: #fb4933;">cond</span> <span style="color: #8ec07c;">(</span><span style="color: #d65d0e;">(</span>&lt;= a b c<span style="color: #d65d0e;">)</span> <span style="color: #d65d0e;">(</span>+ <span style="color: #458588;">(</span>* b b<span style="color: #458588;">)</span> <span style="color: #458588;">(</span>* c c<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span>
@ -327,44 +327,74 @@ Stoy 1977
<span style="color: #d65d0e;">(</span>+kvadrat a b<span style="color: #d65d0e;">)</span> <span style="color: #d65d0e;">(</span>+kvadrat a b<span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>+kvadrat b c<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #d65d0e;">(</span>+kvadrat b c<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>display <span style="color: #b8bb26;">"Pricakovano\n"</span><span style="color: #458588;">)</span> <span style="color: #458588;">(</span>list
<span style="color: #458588;">(</span>display '<span style="color: #b16286;">(</span>85 41 164 89<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> '<span style="color: #b16286;">(</span><span style="color: #b8bb26;">"Pricakovano"</span> 85 41 164 89<span style="color: #b16286;">)</span>
<span style="color: #458588;">(</span>display <span style="color: #b8bb26;">"\nFunkcija1\n"</span><span style="color: #458588;">)</span> <span style="color: #b16286;">(</span>list <span style="color: #b8bb26;">"Funkcija1"</span>
<span style="color: #458588;">(</span>display <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 6 1 7<span style="color: #8ec07c;">)</span>
<span style="color: #b16286;">(</span>list <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 6 1 7<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 3 4 5<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 3 4 5<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 8 10 2<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 8 10 2<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 3 8 5<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov 3 8 5<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>display <span style="color: #b8bb26;">"\nFunkcija2\n"</span><span style="color: #458588;">)</span> <span style="color: #b16286;">(</span>list <span style="color: #b8bb26;">"Funkcija2"</span>
<span style="color: #458588;">(</span>display <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 6 1 7<span style="color: #8ec07c;">)</span>
<span style="color: #b16286;">(</span>list <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 6 1 7<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 3 4 5<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 3 4 5<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 8 10 2<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 8 10 2<span style="color: #8ec07c;">)</span> <span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 3 8 5<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #8ec07c;">(</span>vsota-vecjih-kvadratov2 3 8 5<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre> </pre>
</div> </div>
<pre class="example"> <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
Pricakovano
(85 41 164 89)
Funkcija1 <colgroup>
(85 41 164 73) <col class="org-left" />
Funkcija2
(85 41 164 89) <col class="org-right" />
</pre>
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
</colgroup>
<tbody>
<tr>
<td class="org-left">Pricakovano</td>
<td class="org-right">85</td>
<td class="org-right">41</td>
<td class="org-right">164</td>
<td class="org-right">89</td>
</tr>
<tr>
<td class="org-left">Funkcija1</td>
<td class="org-right">85</td>
<td class="org-right">41</td>
<td class="org-right">164</td>
<td class="org-right">73</td>
</tr>
<tr>
<td class="org-left">Funkcija2</td>
<td class="org-right">85</td>
<td class="org-right">41</td>
<td class="org-right">164</td>
<td class="org-right">89</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
<div id="outline-container-org18cf1c4" class="outline-3"> <div id="outline-container-org9c2a7b0" class="outline-3">
<h3 id="org18cf1c4">1.4</h3> <h3 id="org9c2a7b0">1.4</h3>
</div> </div>
</div> </div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Jurij</p> <p class="author">Author: Jurij</p>
<p class="date">Created: 2024-04-21 ned 17:31</p> <p class="date">Created: 2024-04-21 ned 17:35</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -54,7 +54,7 @@ Stoy 1977
: -43/180 : -43/180
** 1.3 procedura, ki prejme 3 argumente in vrne vsoto kvadratov vecjih dveh ** 1.3 procedura, ki prejme 3 argumente in vrne vsoto kvadratov vecjih dveh
#+begin_src scheme :exports both :results output #+begin_src scheme :exports both :results table
(define (vsota-vecjih-kvadratov a b c) (define (vsota-vecjih-kvadratov a b c)
(cond ((<= a b c) (+ (* b b) (* c c))) (cond ((<= a b c) (+ (* b b) (* c c)))
((<= b a c) (+ (* a a) (* c c))) ((<= b a c) (+ (* a a) (* c c)))
@ -71,30 +71,25 @@ Stoy 1977
(+kvadrat a b) (+kvadrat a b)
(+kvadrat b c)))) (+kvadrat b c))))
(display "Pricakovano\n") (list
(display '(85 41 164 89)) '("Pricakovano" 85 41 164 89)
(display "\nFunkcija1\n")
(display
(list (vsota-vecjih-kvadratov 6 1 7)
(vsota-vecjih-kvadratov 3 4 5)
(vsota-vecjih-kvadratov 8 10 2)
(vsota-vecjih-kvadratov 3 8 5)))
(display "\nFunkcija2\n") (list "Funkcija1"
(display (vsota-vecjih-kvadratov 6 1 7)
(list (vsota-vecjih-kvadratov2 6 1 7) (vsota-vecjih-kvadratov 3 4 5)
(vsota-vecjih-kvadratov2 3 4 5) (vsota-vecjih-kvadratov 8 10 2)
(vsota-vecjih-kvadratov2 8 10 2) (vsota-vecjih-kvadratov 3 8 5))
(vsota-vecjih-kvadratov2 3 8 5)))
(list "Funkcija2"
(vsota-vecjih-kvadratov2 6 1 7)
(vsota-vecjih-kvadratov2 3 4 5)
(vsota-vecjih-kvadratov2 8 10 2)
(vsota-vecjih-kvadratov2 3 8 5)))
#+end_src #+end_src
#+RESULTS: #+RESULTS:
: Pricakovano | Pricakovano | 85 | 41 | 164 | 89 |
: (85 41 164 89) | Funkcija1 | 85 | 41 | 164 | 73 |
: Funkcija1 | Funkcija2 | 85 | 41 | 164 | 89 |
: (85 41 164 73)
: Funkcija2
: (85 41 164 89)
** 1.4 ** 1.4