summaryrefslogtreecommitdiffhomepage
path: root/racket.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'racket.html.markdown')
-rw-r--r--racket.html.markdown22
1 files changed, 11 insertions, 11 deletions
diff --git a/racket.html.markdown b/racket.html.markdown
index d69e7c0d..1a02f988 100644
--- a/racket.html.markdown
+++ b/racket.html.markdown
@@ -205,15 +205,6 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d'
;; Use `hash-remove' to remove keys (functional too)
(hash-remove m 'a) ; => '#hash((b . 2) (c . 3))
-;; Create an empty mutable hash table and manipulate it
-(define m3 (make-hash))
-(hash-set! m3 'a 1)
-(hash-set! m3 'b 2)
-(hash-set! m3 'c 3)
-(hash-ref m3 'a) ; => 1
-(hash-ref m3 'd 0) ; => 0
-(hash-remove! m3 'a)
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 3. Functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -222,7 +213,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d'
;; A function always returns the value of its last expression
(lambda () "Hello World") ; => #<procedure>
;; Can also use a unicode `λ'
-(λ () "Hellow World") ; => same function
+(λ () "Hello World") ; => same function
;; Use parens to call all functions, including a lambda expression
((lambda () "Hello World")) ; => "Hello World"
@@ -464,6 +455,15 @@ n ; => 6
(vector-set! wall 99 'down)
vec ; => #(1 2 3 4)
+;; Create an empty mutable hash table and manipulate it
+(define m3 (make-hash))
+(hash-set! m3 'a 1)
+(hash-set! m3 'b 2)
+(hash-set! m3 'c 3)
+(hash-ref m3 'a) ; => 1
+(hash-ref m3 'd 0) ; => 0
+(hash-remove! m3 'a)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 7. Modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -562,7 +562,7 @@ vec ; => #(1 2 3 4)
(swap! a b)
(printf "tmp = ~a; a = ~a; b = ~a\n" tmp a b) ; tmp is unaffected
-;; But the are still code transformations, for example:
+;; But they are still code transformations, for example:
(define-syntax-rule (bad-while condition body ...)
(when condition
body ...