Fixes a bug in metafunction traces
When the result is in the cache but the cache is not consulted because `caching-enabled?' is false, the call should not be shown as cached.
This commit is contained in:
parent
61607c4da1
commit
b45bb829b6
|
@ -1666,7 +1666,8 @@
|
||||||
(memq name (current-traced-metafunctions)))
|
(memq name (current-traced-metafunctions)))
|
||||||
(parameterize ([current-trace-print-args
|
(parameterize ([current-trace-print-args
|
||||||
(λ (name args kws kw-args level)
|
(λ (name args kws kw-args level)
|
||||||
(if (eq? not-in-cache (hash-ref cache exp not-in-cache))
|
(if (or (not (caching-enabled?))
|
||||||
|
(eq? not-in-cache (hash-ref cache exp not-in-cache)))
|
||||||
(display " ")
|
(display " ")
|
||||||
(display "c"))
|
(display "c"))
|
||||||
(ot name (car args) kws kw-args level))]
|
(ot name (car args) kws kw-args level))]
|
||||||
|
|
|
@ -784,6 +784,14 @@
|
||||||
(term (f 1)))
|
(term (f 1)))
|
||||||
(test (get-output-string sp) "c>(f 1)\n <0\n"))
|
(test (get-output-string sp) "c>(f 1)\n <0\n"))
|
||||||
|
|
||||||
|
(let ([sp (open-output-string)])
|
||||||
|
(parameterize ([current-output-port sp]
|
||||||
|
[current-traced-metafunctions 'all]
|
||||||
|
[print-as-expression #f]
|
||||||
|
[caching-enabled? #f])
|
||||||
|
(term (f 1)))
|
||||||
|
(test (get-output-string sp) " >(f 1)\n > (f 0)\n < 0\n <0\n"))
|
||||||
|
|
||||||
(let ([sp (open-output-string)])
|
(let ([sp (open-output-string)])
|
||||||
(parameterize ([current-output-port sp]
|
(parameterize ([current-output-port sp]
|
||||||
[current-traced-metafunctions '(f)]
|
[current-traced-metafunctions '(f)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user