Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lab5-metaprogramming-and-debugging-lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Olsson
lab5-metaprogramming-and-debugging-lab
Commits
71b18cb3
Commit
71b18cb3
authored
5 years ago
by
Daniel Olsson
Browse files
Options
Downloads
Patches
Plain Diff
Macro works now but does not give correct line number
parent
1be6d216
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
julia/dowhile.jl
+6
-4
6 additions, 4 deletions
julia/dowhile.jl
julia/run.jl
+1
-1
1 addition, 1 deletion
julia/run.jl
with
7 additions
and
5 deletions
julia/dowhile.jl
+
6
−
4
View file @
71b18cb3
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
julia/run.jl
+
1
−
1
View file @
71b18cb3
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment