[racket/en] fix indentation and spacing (#4251)

* Fix indentation and spacing

* One more fix
This commit is contained in:
sorawee 2021-10-23 09:46:48 -07:00 committed by GitHub
parent 1670518461
commit ed198750d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,7 +413,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d'
(loop 5) ; => i=5, i=6, ... (loop 5) ; => i=5, i=6, ...
;; Similarly, with a named let ;; Similarly, with a named let
(let loop ((i 0)) (let loop ([i 0])
(when (< i 10) (when (< i 10)
(printf "i=~a\n" i) (printf "i=~a\n" i)
(loop (add1 i)))) ; => i=0, i=1, ... (loop (add1 i)))) ; => i=0, i=1, ...
@ -441,17 +441,19 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d'
(for ([i (in-set (set 'x 'y 'z))]) (for ([i (in-set (set 'x 'y 'z))])
(displayln i)) (displayln i))
(for ([(k v) (in-hash (hash 'a 1 'b 2 'c 3 ))]) (for ([(k v) (in-hash (hash 'a 1 'b 2 'c 3))])
(printf "key:~a value:~a\n" k v)) (printf "key:~a value:~a\n" k v))
;;; More Complex Iterations ;;; More Complex Iterations
;; Parallel scan of multiple sequences (stops on shortest) ;; Parallel scan of multiple sequences (stops on shortest)
(for ([i 10] [j '(x y z)]) (printf "~a:~a\n" i j)) (for ([i 10] [j '(x y z)])
(printf "~a:~a\n" i j))
; => 0:x 1:y 2:z ; => 0:x 1:y 2:z
;; Nested loops ;; Nested loops
(for* ([i 2] [j '(x y z)]) (printf "~a:~a\n" i j)) (for* ([i 2] [j '(x y z)])
(printf "~a:~a\n" i j))
; => 0:x, 0:y, 0:z, 1:x, 1:y, 1:z ; => 0:x, 0:y, 0:z, 1:x, 1:y, 1:z
;; Conditions ;; Conditions
@ -663,8 +665,7 @@ vec ; => #(1 2 3 4)
(define amount 0) (define amount 0)
(define (deposit a) (set! amount (+ amount a))) (define (deposit a) (set! amount (+ amount a)))
(define (balance) amount) (define (balance) amount))
)
(require 'bank-account) (require 'bank-account)
(deposit 5) (deposit 5)