Commit 413d83db authored by Dan Holtby's avatar Dan Holtby
Browse files

re-fixed trace within local

parent 09786019
......@@ -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
(syntax/loc stx
(letrec ([f (λ (arg ...) body)])
(trace f)
[(f1) (generate-temporaries #'(f))])
(syntax/loc stx
(student-define (f arg ...) (f1 arg ...))))]
(define f1 (letrec ([f (λ (arg ...) body)])
(trace 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment