LaboratoryForPlayfulComputation / blockytalky

A toolkit for learning CS through networked physical computing
BSD 2-Clause "Simplified" License
28 stars 7 forks source link

Replace context opt in send message with compile time check #60

Closed mpahrens closed 8 years ago

mpahrens commented 8 years ago

Currently, the blockly transpiler checks if a send message block is:

The reason is that to send a "well timed" message from the defmotif, then the DSL compiler needs to generate Sonic Pi ruby DSL code to send the message from sonic pi at that musical moment to the BT message API, not at the moment the motif is defined (top level).

Instead:

This will turn statements that look like:

start do
send_message("hello","walle",context: :top)
end
defmotif "melody" do
wait_for(:beat1)
send_message("ping","walle", context: :music)
end
into
start do
send_message("hello","walle")
end
defmotif "melody" do
wait_for(:beat1)
send_message("ping","walle")
end

bennytheshap commented 8 years ago

👍🏿

mpahrens commented 8 years ago

Done, in test branch, will test on Pi this week and merge if successful

mpahrens commented 8 years ago

merged into 0.4.1 (lang) but I didn't change the code gen (blockly) to remove the opts until I can do some more testing, but it works as expected