snapapps / edgy

a visual programming language inspired by Scratch
http://snapapps.github.io/
GNU Affero General Public License v3.0
51 stars 21 forks source link

Saved block sequences omit variables #345

Closed stevenbird closed 7 years ago

stevenbird commented 9 years ago

The gallery page includes an example for Dijkstra's algorithm. When I import it to Edgy, the start_node variable defined in the code does not exist as a variable in the Variables tab.

http://www.snap-apps.org/edgy.html

cyderize commented 9 years ago

Custom block exports also leave out global variables. Should that be changed as well?

stevenbird commented 9 years ago

Right. It should be possible to import these saved materials and have them behave properly. One step we already do is look for dependent blocks and export those as well. Identifying any global variables is a similar case, i.e. a name defined in the surrounding context that is required by a custom block or block sequence.

cyderize commented 9 years ago

So export blocks should be extended to also allow exporting of global variables (probably using a checkbox like for attributes)

Looking at the Dijkstra example, we'd also have to export node attributes along with the block sequence and global variables for it to work. At the moment all we do is warn if custom blocks are used (and if they are, we still don't export them).

I think the user should be given the option to export the dependencies - for example, we check for custom blocks, global variables, and node/edge attributes; if any are found we show a dialog with checkboxes allowing the dependencies to be exported.

Exporting is rather messy, since everything can have dependencies (even variables can have dependencies on custom blocks if they've been ringified).

stevenbird commented 9 years ago

Let's hold off on this for now.