diff --git a/zapiski/1_g1smo.html b/zapiski/1_g1smo.html index ffd4401..6f53734 100644 --- a/zapiski/1_g1smo.html +++ b/zapiski/1_g1smo.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Zapiski #1 srečanja programerskega bralnega krožka SICP @@ -198,13 +198,13 @@

Zapiski #1 srečanja programerskega bralnega krožka SICP

-
-

Zanimivi izseki

-
+
+

Zanimivi izseki

+
-
-

str. 9

-
+
+

str. 9

+

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.

-
-

str. 11

-
+
+

str. 11

+

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

-
-

str. 18

-
+
+

str. 18

+

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

-
-

str. 19

-
+
+

str. 19

+

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

-
-

str. 27

-
+
+

str. 27

+

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

-
-

str. 77

-
+
+

str. 77

+

Stoy 1977

-
-

Vaje

-
+
+

Vaje

+
-
-

1.1 Kaj vrnejo izrazi?

+
+

1.1 Kaj vrnejo izrazi?

-
-

1.2 Pretvori izraz v prefix obliko

-
+
+

1.2 Pretvori izraz v prefix obliko

+
(/ (+ 5 4
       (- 2
@@ -307,28 +307,83 @@ Stoy 1977
 
-
-

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

+
(define (vsota-vecjih-kvadratov a b c)
   (cond ((<= a b c) (+ (* b b) (* c c)))
         ((<= b a c) (+ (* a a) (* c c)))
         (else (+ (* b b) (* a a)))))
+;; ^ NAROBE! <= primerja vse tri stevilke, ne prvo z drugima dvema oz. ostalimi
 
-(vsota-vecjih-kvadratov 6 1 7)
+(define (+kvadrat a b) (+ (* a a) (* b b)))
+(define (vsota-vecjih-kvadratov2 a b c)
+  (if (>= a b)
+      (if (>= b c)
+          (+kvadrat a b)
+          (+kvadrat a c))
+      (if (>= a c)
+          (+kvadrat a b)
+          (+kvadrat b c))))
+
+(list
+  "Pricakovano"
+  '(85 41 164 89)
+
+  "Funkcija1"
+  (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))
+
+  "Funkcija2"
+  (list (vsota-vecjih-kvadratov2 6 1 7)
+        (vsota-vecjih-kvadratov2 3 4 5)
+        (vsota-vecjih-kvadratov2 8 10 2)
+        (vsota-vecjih-kvadratov2 3 8 5)))
 
-
-85
-
+ + + +++ ++ ++ ++ ++ ++ + + + + + + + + + + +
Pricakovano(85 41 164 89)Funkcija1(85 41 164 73)Funkcija2(85 41 164 89)
-
-

1.4

+ +
+

1.4

+
+

Author: Jurij

+

Created: 2024-04-21 ned 17:14

+

Validate

+