exercises and notes from "Gentle introduction"

This commit is contained in:
efim
2022-07-24 11:52:07 +00:00
commit 067aebaf81
21 changed files with 1597 additions and 0 deletions

23
break-and-error.lisp Normal file
View File

@@ -0,0 +1,23 @@
(defun analyze-profit (price comission-rate)
(let* ((comission (* price comission-rate))
(result (cond ((> 100 comission) 'rich)
((< 100 comission) 'poor))))
(break "~&The value of result is ~S" result)
(format t "~&I predict that you will be: ~S" result)
result))
(analyze-profit 2200 0.06)
(analyze-profit 2000 0.05)
;;; So - debugger keys and functions
;; C-j and C-k are for moving between frames
;; for frame context commands R - return from frame with particular value (sly-db-return-from-frame)
;; x - step over, s - step
;; e - eval in frame, i - inspect in frame (show additional info on evaluated value)
;; RET - toggle details for current frame
;; v - show frames code
;; d - pretty-print-eval-in-frame
;; (searching all of functions by going into debugger bugger and looking at *helpful* (C-h C-f) "sly-db-"
;; could also try to recompile thing, maybe r for restart, or R to return with value 1 from last frame and check how it all works