From a7e28600e24e8c33e590c1d0c096e3d6f7a5663c Mon Sep 17 00:00:00 2001 From: Albert Lundberg <alblu482@student.liu.se> Date: Tue, 18 Oct 2022 11:39:50 +0000 Subject: [PATCH] =?UTF-8?q?Ska=20vara=20en=20riktigt=20do=20whlie=20nu,=20?= =?UTF-8?q?k=C3=B6r=20alltid=20minst=20en=20g=C3=A5ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- julia/dowhile.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia/dowhile.jl b/julia/dowhile.jl index d1b55dd..1006da8 100644 --- a/julia/dowhile.jl +++ b/julia/dowhile.jl @@ -3,9 +3,11 @@ macro doWhile(block, cond) println("cond ", cond) println("block ", block) res = quote - while $(esc(cond)) + while true $(esc(block)) - end + if !($(esc(cond))) + break + end end println(res) # For debugging; should not print any lines referencing dowhile.jl if doing the optional part -- GitLab