[racket] Projectional Editors

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Jul 5 09:26:50 EDT 2013

I think DrRacket has all of the tools necessary to do what you're asking,
but there is no convenient API for putting it all together. Depending on
how you wanted it to look, I'd offer different suggestions on how to get
started, I guess. For example, if you're happy with the projections being
in a separate window<%> object, that'd be the easiest thing, I guess (and
much of the work you'd do could be re-used if you wanted a different way to
draw it, with a little bit of planning).

Are you thinking of using the raw source code to get the projection, or are
you planning to involve macro expansion?

Robby


On Fri, Jul 5, 2013 at 2:52 AM, Tony Clark <t.n.clark at mdx.ac.uk> wrote:

> Dear All,
>
> I am implementing a language that involves patterns over sets. I am
> experimenting with an 'indexed set' pattern of the form:
>
> (iU (index-var limit-var) pattern …)
>
> Where pattern can include constants, (indexed) variables, (indexed) sets
> and terms. For example:
>
> (iU (i n) (Person (index name i)))
>
> Matches a set of terms:
>
> '((Person fred) (Person bert) (Person sally))
>
> To produce a binding environment:
>
> '((n . 2) (name-0 . fred) (name-1 . bert) (name-2 . sally))
>
> My question is whether DrRacket can be extended with 'projectional
> editing' features so that:
>
> (iU (i n) (Person (index name i)))
>
> When entered, is displayed using the equivalent of latex:
>
> $\bigcup_{i\in[0,n]} (Person (index name i))$
>
> A projectional editor (
> http://martinfowler.com/bliki/ProjectionalEditing.html) works by
> representing the AST of a language and then providing the user with a view
> of the AST, thereby allowing fancy representations. Whether the user can
> interact with the fancy representation or has to work at the AST level
> depends on the projectional editor.
>
> I think DrRacket ought to be ideal for this kind of thing since: (a) we
> are essentially working on an AST already; (2) the editor appears to be
> programmable; (3) the GUI libraries allow easy dynamic creation of images
> that can be inserted into the editor.
>
> I looked at the reference for DrRacket Plugins, but encountered a large
> interface that I am unsure how to navigate.
>
> Thanks for any pointers.
>
> -- Tony
>
>
>
> ---------------------------------------------------------------------------
>
>
> Please note that Middlesex University's preferred way of receiving all
> correspondence is via email in line with our Environmental Policy. All
> incoming post to Middlesex University is opened and scanned by our digital
> document handler, CDS, and then emailed to the recipient.
>
> If you do not want your correspondence to Middlesex University processed
> in this way please email the recipient directly. Parcels, couriered items
> and recorded delivery items will not be opened or scanned by CDS.  There
> are items which are "exceptions" which will be opened by CDS but will not
> be scanned a full list of these can be obtained by contacting the
> University.
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130705/94de06b6/attachment.html>

Posted on the users mailing list.