diff --git a/julia/dowhile.jl b/julia/dowhile.jl index 5f770673faff2d8d7f2b119cfe6f8753deba9892..4cd7c3a9856f365fba7914025dc00f66f032b1a3 100644 --- a/julia/dowhile.jl +++ b/julia/dowhile.jl @@ -2,11 +2,13 @@ macro doWhile(block, cond) println("__source__ ", __source__) println("cond ", cond) println("block ", block) - res = quote - error("TODO: Your code here") - - + res = quote + #error("TODO: Your code here") + $(esc(block)) + while $(esc(cond)) + $(esc(block)) + end end println(res) # Should not print any lines referencing dowhile.jl res diff --git a/julia/run.jl b/julia/run.jl index e0495f90ceff96d1d48b4f79d82e56df8c852cc1..0f4341ac966bfad3fedeaaa1aeeea08ccec43992 100644 --- a/julia/run.jl +++ b/julia/run.jl @@ -30,7 +30,7 @@ end m = Base.methods(Problem1.f, [Int]) Base.delete_method(m.ms[1]) @assert 2 == Problem1.f(1) -println(Problem1.f(1)) + # TODO: Make an until block for Julia, similar to do {} while (cond); in C # # Make sure that any assertions and error-messages refer to lines in the original code.