Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Feb 10, 2024
1 parent 3ba2828 commit ea2799f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion notes/guix-guile-nix/guile.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,19 @@
;; try-catch
;; See https://vijaymarupudi.com/blog/2022-02-13-error-handling-in-guile.html
(begin
(use-modules (ice-9 exceptions))
(guard (exception (else (format #t "[catch] An exception was thrown:\n")
(format #t "[catch] ~a\n\n" exception)))
(format #t "[try]")
(/ 1 0)
(format #t "[try] Unreachable\n"))
(format #t "Moving n.\on"))
(format #t "Moving on.\n"))

;; ignore exception
(begin
(use-modules (ice-9 exceptions))
(guard (exception (else #f)) (/ 1 0))
(format #t "Moving on.\n"))

;; See https://vijaymarupudi.com/blog/2022-02-13-error-handling-in-guile.html
(use-modules (ice-9 exceptions))
Expand Down

0 comments on commit ea2799f

Please sign in to comment.