I finally had some time to revisit this.  I'm hoping someone can help me 
out a bit more.


I made a basic renderer that takes arbitrary S-expressions and renders them 
as bricks.  I've made an interface for editing the bricks (and thus editing 
the S-expressions underneath).


What I would like to do now is seamlessly integrate these brick-expressions 
(B-expressions?) into arbitrary Racket files using some kind of custom 
snip%.


Here's a not-working prototype of what it should look like:


<https://lh3.googleusercontent.com/-kdfl-pNWFFo/WuI_Ke1hfDI/AAAAAAAADLc/2TZNVfty_vET2wOvZtAhZ504RDKogaTbACLcBGAs/s1600/Screen%2BShot%2B2018-04-26%2Bat%2B2.03.40%2BPM.png>


Notice that line #9 has the B-expression.  Line #7 has a comment showing 
the equivalent S-expression.  Also notice that the B-expression contains a 
reference to the constant defined in an S-expression on line #5.  And vice 
versa, notice that the S-expression on line #11 references the constant 
defined in the B-expression.  This two-way interoperability between 
B-expressions and S-expressions within the same file is something I think 
would be pedagogically valuable.


I'd love to implement this, but I'm looking for suggestions.


Let's just suppose I've implemented a special b-expression-snip% class.  (I 
haven't, but I think I could).


How might I go about getting the above to work.  Here are some random, 
vague, probably-misguided musings about implementations -- meant to 
stimulate discussion:


   - Get DrRacket to render the b-expression-snip% as an image but 
   otherwise treat it as a normal S-expression, just as if it had been written 
   as such.
   - Get the b-expression-snip%'s associated S-expression to be "evaled" in 
   the context of the module -- without having to wrap the snip in a helper 
   S-expression, e.g. (my-eval ...).
   - Get the b-expression-snip%'s presence to somehow "inject" its 
   S-expression into the module/file/etc.
   - Implement some kind of special *#lang racket-with-bricks* that 
   intercepts the code before execution and swaps all B-expressions for their 
   associated S-expressions.

Any ideas, pointers, references, etc. would all be appreciated.  Thanks in 
advance!


On Wednesday, December 27, 2017 at 8:30:16 PM UTC-8, Stephen Foster wrote:
>
> If I wanted to build a drag-and-drop, visual programming interface for 
> programming in DrRacket, is there any prior work I can build on?  Ideally, 
> I'd like to implement this as a DrRacket "snip", so that my students can 
> make programs that are partially text-based and partially visual.  Any 
> suggestions?  Has anyone done something in the ballpark?  
>

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to