Skip to content

Commit

Permalink
Multiple typo fixes
Browse files Browse the repository at this point in the history
Corrected for some typos I found while working through the exercises. Both in "./koans" and "./koans-solved".
  • Loading branch information
JonasWoeg committed Oct 16, 2022
1 parent fa286eb commit 84c5757
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions koans-solved/backquote.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
;; , unquotes a part of the expression.
(assert-equal '((123) 45 6 z) `(,x 45 6 z))
(assert-equal '((123) 45 6 (7 8 9)) `(,x 45 6 ,z))
;; ,@ splices an expression into the into the list surrounding it.
;; ,@ splices an expression into the list surrounding it.
(assert-equal '((123) 45 6 7 8 9) `(,x 45 6 ,@z))
(assert-equal '(123 45 6 7 8 9) `(,@x 45 6 ,@z))))

(define-test backquote-forms
;; Because of its properties, backquote is useful for constructing Lisp forms
;; that are macroexpansions or parts of macroexpansions.
(let ((variable 'x))
;; Fill in the blank without without using backquote/unquote notation.
;; Fill in the blank without using backquote/unquote notation.
(assert-equal '(if (typep x 'string)
(format nil "The value of ~A is ~A" 'x x)
(error 'type-error :datum x :expected-type 'string))
Expand All @@ -44,7 +44,7 @@
:expected-type 'string))))
(let ((error-type 'type-error)
(error-arguments '(:datum x :expected-type 'string)))
;; Fill in the blank without without using backquote/unquote notation.
;; Fill in the blank without using backquote/unquote notation.
(assert-equal '(if (typep x 'string)
(format nil "The value of ~A is ~A" 'x x)
(error 'type-error :datum x :expected-type 'string))
Expand Down
2 changes: 1 addition & 1 deletion koans-solved/condition-handlers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
(assert-equal '(:my-error) *list*)))

(define-test handler-case-type
;; A handler cases is not executed if it does not match the condition type.
;; A handler case is not executed if it does not match the condition type.
(let ((*list* '()))
(handler-case (signal (make-condition 'error))
(my-error (condition) (handle-my-error condition))
Expand Down
2 changes: 1 addition & 1 deletion koans-solved/control-statements.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
;; IF only evaluates and returns one branch of a conditional expression.
(assert-equal :true (if t :true :false))
(assert-equal :false (if nil :true :false))
;; This also applies to side effects that migh or might not be evaluated.
;; This also applies to side effects that might or might not be evaluated.
(let ((result))
(if t
(setf result :true)
Expand Down
2 changes: 1 addition & 1 deletion koans-solved/mapcar-and-reduce.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

(define-test mapcar
(let ((numbers '(1 2 3 4 5 6)))
;; Inside MAPCAR, he function 1+ will be applied to each element of NUMBERS.
;; Inside MAPCAR, the function 1+ will be applied to each element of NUMBERS.
;; A new list will be collected from the results.
(assert-equal '(2 3 4 5 6 7) (mapcar #'1+ numbers))
(assert-equal '(-1 -2 -3 -4 -5 -6) (mapcar #'- numbers))
Expand Down
2 changes: 1 addition & 1 deletion koans-solved/nil-false-empty.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

(define-test or
;; The logical operator OR can also take multiple arguments.
(true-or-false? t (or nil nil nil t nil))
(true-or-false? t (or nil nil nil t nil))
;; OR returns the first non-NIL value it encounters, or NIL if there are none.
(assert-equal nil (or nil nil nil))
(assert-equal 1 (or 1 2 3 4 5)))
6 changes: 3 additions & 3 deletions koans/backquote.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
;; , unquotes a part of the expression.
(assert-equal ____ `(,x 45 6 z))
(assert-equal ____ `(,x 45 6 ,z))
;; ,@ splices an expression into the into the list surrounding it.
;; ,@ splices an expression into the list surrounding it.
(assert-equal ____ `(,x 45 6 ,@z))
(assert-equal ____ `(,@x 45 6 ,@z))))

(define-test backquote-forms
;; Because of its properties, backquote is useful for constructing Lisp forms
;; that are macroexpansions or parts of macroexpansions.
(let ((variable 'x))
;; Fill in the blank without without using backquote/unquote notation.
;; Fill in the blank without using backquote/unquote notation.
(assert-equal ____
`(if (typep ,variable 'string)
(format nil "The value of ~A is ~A" ',variable ,variable)
(error 'type-error :datum ,variable
:expected-type 'string))))
(let ((error-type 'type-error)
(error-arguments '(:datum x :expected-type 'string)))
;; Fill in the blank without without using backquote/unquote notation.
;; Fill in the blank without using backquote/unquote notation.
(assert-equal ____
`(if (typep x 'string)
(format nil "The value of ~A is ~A" 'x x)
Expand Down
2 changes: 1 addition & 1 deletion koans/condition-handlers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
(assert-equal ____ *list*)))

(define-test handler-case-type
;; A handler cases is not executed if it does not match the condition type.
;; A handler case is not executed if it does not match the condition type.
(let ((*list* '()))
(handler-case (signal (make-condition 'error))
(my-error (condition) (handle-my-error condition))
Expand Down
2 changes: 1 addition & 1 deletion koans/control-statements.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
;; IF only evaluates and returns one branch of a conditional expression.
(assert-equal ____ (if t :true :false))
(assert-equal ____ (if nil :true :false))
;; This also applies to side effects that migh or might not be evaluated.
;; This also applies to side effects that might or might not be evaluated.
(let ((result))
(if t
(setf result :true)
Expand Down
2 changes: 1 addition & 1 deletion koans/mapcar-and-reduce.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

(define-test mapcar
(let ((numbers '(1 2 3 4 5 6)))
;; Inside MAPCAR, he function 1+ will be applied to each element of NUMBERS.
;; Inside MAPCAR, the function 1+ will be applied to each element of NUMBERS.
;; A new list will be collected from the results.
(assert-equal '(2 3 4 5 6 7) (mapcar #'1+ numbers))
(assert-equal ____ (mapcar #'- numbers))
Expand Down
2 changes: 1 addition & 1 deletion koans/nil-false-empty.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

(define-test or
;; The logical operator OR can also take multiple arguments.
(true-or-false? ____ (or nil nil nil t nil))
(true-or-false? ____ (or nil nil nil t nil))
;; OR returns the first non-NIL value it encounters, or NIL if there are none.
(assert-equal ____ (or nil nil nil))
(assert-equal ____ (or 1 2 3 4 5)))

0 comments on commit 84c5757

Please sign in to comment.