From d8850b22d21e1a034ed558289c08d36ddd2f796d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 6 Dec 2022 22:12:43 +0200 Subject: Fix examples/impure-concept.milch --- examples/impure-concept.milch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/impure-concept.milch b/examples/impure-concept.milch index 75c3bb7..0a9af05 100644 --- a/examples/impure-concept.milch +++ b/examples/impure-concept.milch @@ -1,3 +1,5 @@ +(import "core/common") + ; What color is your function? ; Impure functions are functions that can call both pure and impure functions. ; Pure functions can only call pure functions. @@ -11,7 +13,7 @@ (f 10) ; works ; this is an impure function -(let g! (\![x] (println! x))) +(let g! (\![x] (print-fmt! "{0}\n" [x]))) (g! "foo") ; works @@ -20,6 +22,6 @@ (h "bar") ; error: cannot call impure function in pure context -; when calling function g! at examples/purity-test.milch:19:15 -; in a function definition at examples/purity-test.milch:19:12 -; when calling function h at examples/purity-test.milch:21:1 \ No newline at end of file +; when calling function g! at examples/impure-concept.milch:21:14 +; in a function definition at examples/impure-concept.milch:21:11 +; when calling function h at examples/impure-concept.milch:23:1 \ No newline at end of file -- cgit v1.3