I'm trying to make a project that compiles my text-based programming language BariLang to Snap! code via a homemade dictionary of supported blocks, then joining them with join.
[scratchblocks]
(dictionary (item key[if] value ({if <>::control}@addInput::grey ring)::list)⯇@addInput ::list) //My dictionary library
(join (list::list) by [blocks v]::operators)
[/scratchblocks]
I know that split and join by blocks use a tree to represent the data. But, how does that work? how would I make my own tree?
I mean being able to create something complicated like
[scratchblocks]
ask [What is your name?] and wait
if < (answer)= [BlueBaritone21]>::control {
say [Hello, Me!]
else
say (join [Hello, ] (answer))
end
wait (1) seconds
say [more stuff]
[/scratchblocks]
(Where the inputs are joined, along with the stack.)