First, thanks for the reply. Itβs valuable to have the author of the paper
from where I draw my example chime in π
1) Instead of turning the cache off completely, you could just
invalidate the cache when the parameter changes, i.e. write a `set-k!'
function that updates the parameter and toggles the cache off and back
on (I assume this will clear it out).
I believe the following program proves your assumption wrong:
* * *
#lang racket/base
(require redex/reduction-semantics racket/list)
(define k (make-parameter 0))
(define-language L
[e ::= any]
[t ::= [e ...]])
(define-metafunction L
tick : e _ _ _ t -> t
[(tick e _ _ _ t) ,(take (cons (term e) (term t)) (k))])
(term (tick a _ _ _ [])) ;; => '()
(parameterize* ([k 1]
[caching-enabled? #f]
[caching-enabled? #t])
(term (tick b _ _ _ []))) ;; => '(b)
(parameterize ([k 1]
[caching-enabled? #f]
[caching-enabled? #t])
(term (tick a _ _ _ []))) ;; => '()
* * *
If the cache was flushed, then weβd see β'(a)β instead of β'()β in the last
term.
As I pointed out in my original message: cache invalidation continues to be
one of the *hard problems* in computer science.
3) Move the escaping ellipses to the outermost `begin' form. This
allows you to write the escape once instead of for each Redex ellipse.
It also means the code within the macro definition looks more like the
original.
That is one step in the right direction. Thanks for the suggestion. But I
still think macro-defined models are not the right abstraction here.
--
Leandro Facchinetti <[email protected]>
https://www.leafac.com
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.