mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-10-05 09:08:02 +03:00
Indentation fixes.
This commit is contained in:
parent
fa1ef10edd
commit
6b282360b0
@ -250,18 +250,18 @@ m ; => '#hash((b . 2) (a . 1) (c . 3))
|
|||||||
|
|
||||||
(if #t ; test expression
|
(if #t ; test expression
|
||||||
"this is true" ; then expression
|
"this is true" ; then expression
|
||||||
"this is false" ; else expression
|
"this is false") ; else expression
|
||||||
) ; => "this is true"
|
; => "this is true"
|
||||||
|
|
||||||
;; In conditionals, all non-#f values are treated as true
|
;; In conditionals, all non-#f values are treated as true
|
||||||
(member "Groucho" '("Harpo" "Groucho" "Zeppo")) ; => '("Groucho" "Zeppo")
|
(member "Groucho" '("Harpo" "Groucho" "Zeppo")) ; => '("Groucho" "Zeppo")
|
||||||
(if (member "Groucho" '("Harpo" "Groucho" "Zeppo"))
|
(if (member "Groucho" '("Harpo" "Groucho" "Zeppo"))
|
||||||
'yep
|
'yep
|
||||||
'nope) ; => 'yep
|
'nope)
|
||||||
|
; => 'yep
|
||||||
|
|
||||||
;; "cond" chains a series of tests to select a result
|
;; "cond" chains a series of tests to select a result
|
||||||
(cond
|
(cond [(> 2 2) (error "wrong!")]
|
||||||
[(> 2 2) (error "wrong!")]
|
|
||||||
[(< 2 2) (error "wrong again!")]
|
[(< 2 2) (error "wrong again!")]
|
||||||
[else 'ok]) ; => 'ok
|
[else 'ok]) ; => 'ok
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user