At Sun, 24 Aug 2014 17:03:56 -0600, Maria Jenkins wrote:
> I am writing a paper and the implementation was done in redex.
> 
> My question is when I render the semantics and state space is there a way to 
> get a wide hat symbol to print out over some of the characters like in latex?

Someone else may have a better answer, but the enclosed example shows
one approach. It implements a rewriter for `in-hat`, which causes the
term

 (in-hat apple)

to render as "apple" with a hat.

The "hat.scrbl" file just uses the pict in a demo document.


The rewriter for `in-hat` works by first rendering the argument to a
pict. Then, it uses the `dc` pict constructor to generate a hat, where
the function passed to `dc` uses the `racket/draw` library. The hat is
placed on the argument with `pin-over`, which is also from the `pict`
library. Finally, the `refit` helper function makes the generated
representation have the same line and column span as the original so
that it will work right in a larger context.

(None of that is easy; if this is on the right track, then clearly it
belongs in a library.)

Attachment: hat.rkt
Description: Binary data

Attachment: hat.scrbl
Description: Binary data

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to