[racket] Redex: how do you interpret this typesetting error?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Sep 26 13:53:56 EDT 2012

The traditionally correct notation for substitutions is 
 (1) e[x - v]
xor 
 (2) [v/x]e 

The now-common mix of e[x/v] is considered wrong. 
(Even if I have used it the past or have allowed 
students to use it.) 



On Sep 25, 2012, at 3:13 PM, Asumu Takikawa wrote:

> Hi all,
> 
> I'm trying to define a Redex lw rewriter that will typeset substitution
> nicely, but I'm getting an error that I don't know how to interpret.
> I've gotten this before in the past with other rewriters and I've never
> been able to figure it out.
> 
> Here is the definition of the rewriter and the error that I get:
> 
> (define (subst-rewriter lws)
>  (define e (list-ref lws 2))
>  (define x (list-ref lws 3))
>  (define v (list-ref lws 4))
>  (list e "[" v " / " x "]"))
> 
> adjust-spacing: for subst; loc-wrapper takes up too many columns. Expected it to not pass 17, but it went to 20
>  context...:
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:308:4: loop
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:308:4: loop
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:308:4: loop
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:201:4: ar/e
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:166:2: apply-rewrites
>   /home/asumu/plt/racket-git/collects/redex/private/core-layout.rkt:157:2: lw->pict
>   /home/asumu/plt/racket-git/collects/redex/private/pict.rkt:144:0
>   /home/asumu/plt/racket-git/collects/redex/private/../../racket/private/map.rkt:26:19: loop
>   /home/asumu/plt/racket-git/collects/redex/private/pict.rkt:108:0: do-reduction-relation->pict
>   /home/asumu/docs/control-proxy/paper/typesetting.rkt: [running body]
>   /home/asumu/docs/control-proxy/paper/model.scrbl: [traversing imports]
>   /home/asumu/docs/control-proxy/paper/control-proxy.scrbl: [traversing imports]
>   /home/asumu/plt/racket-git/collects/scribble/../racket/private/map.rkt:26:19: loop
>   /home/asumu/plt/racket-git/collects/scribble/run.rkt: [running body]
> 
> Any idea how I can work around this?
> 
> Cheers,
> Asumu
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.