Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dan Holtby
uwaterloo-racket
Commits
413d83db
Commit
413d83db
authored
Nov 14, 2020
by
Dan Holtby
Browse files
re-fixed trace within local
parent
09786019
Changes
1
Hide whitespace changes
Inline
Side-by-side
trace.rkt
View file @
413d83db
...
...
@@ -14,14 +14,13 @@
; break hygiene to snag define from the current lexical context
([
student-define
(
datum->syntax
stx
'define
)]
; generate a fake name for the real function. temporaries are always distinct
[
f1
(
syntax-local-lift-expression
(
syntax/loc
stx
(
letrec
([
f
(
λ
(
arg
...
)
body
)])
(
trace
f
)
f
)))])
[(
f1
)
(
generate-temporaries
#'
(
f
))])
(
syntax/loc
stx
(
student-define
(
f
arg
...
)
(
f1
arg
...
))))]
(
begin
(
define
f1
(
letrec
([
f
(
λ
(
arg
...
)
body
)])
(
trace
f
)
f
))
(
student-define
(
f
arg
...
)
(
f1
arg
...
)))))]
[(
_
name
value
)
; if they try to use it to define a constant
(
raise-syntax-error
'define/trace
"define/trace can only be used to define functions"
stx
)]
[(
_
arg
...
)
; other cases it just maps to a define so that that syntax can raise its own errors
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment