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

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Sep 25 15:25:11 EDT 2012

The problem stems from the fact that you reversed the v and the x in
the result as compared to the input. That ends up making the column
numbers inside the objects in v look strange as compared to those in x
and confusing Redex. You can just change the order of the args to
subst, or you can only call this with identifiers and then change the
rewriter so you drop that column information, replacing it with your
own, made up column information.

Robby

On Tue, Sep 25, 2012 at 2:13 PM, Asumu Takikawa <asumu at ccs.neu.edu> 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.