(Arne Babenhauserheide)
2016-05-12: cleanup + documentation + note potential catch cleanup + documentation + note potential catch
diff --git a/examples/with.w b/examples/with.w --- a/examples/with.w +++ b/examples/with.w @@ -5,14 +5,14 @@ exec guile -L $(dirname $(dirname $(real ;; A cleaner way to implement this might be using dynamic-wind. +;; FIXME: This might not be continuation-safe and might break if the +;; code in the with block uses dynamic-wind. Check whether it’s safe +;; and fix it if not. + define-module : examples with import : oop goops -; import : ice-9 rdelim -; with (open-file "with.w") as port -; display : read-line port - define : enter thing . thing define-generic enter @@ -31,6 +31,7 @@ define-syntax with . res define-method : exit (thing <port>) + . "Ensure that a port is always closed at the end of the with-block." close-port thing define : main args