local & project data bug?

. @Simeon If I create a program named TEST and it creates a bunch of local data, the local data doesn’t get deleted when I delete the program TEST. If I create another program and call it TEST and do a listLocalData before doing anything, I see all the local data from the previous program or for every prevoius program called TEST that created local data. Shouldn’t the data get deleted when the program gets deleted. If it doesn’t, then how much memory is being used up storing local data from deleted programs, and how can I find undeleted local data if I don’t remember the program names.

It’s not a bug, it’s a feature!

Seriously, I don’t know if it is a feature. It would be in a desktop environment like Windows, where the usual process of upgrading a program is to first uninstall the old one and install the new one while keeping all the settings. Perhaps it’s the same reasoning here.

I assume that the local data isn’t stored in the project folder but in a global folder. This may root back to when Codea had the ability to export projects. The project data was meant to be included in the project, the local data not so. An easy way to achieve this would be to store the local data elsewhere, so exporting is just a matter of publishing the folder.

I assume further that local data is not stored in the project folder in order to be able to track data like high scores when playing e.g. Cargo-Bot from the examples.

The question is now if the data is deliberately left in place when deleting a project. I think only Simeon can answer that. (Yes, that’s why you pointed your question to him.)

What would be nice is a function like, listLocalPrograms, listProjectPrograms, and listGlobalPrograms that when called would create a table of program names that have local, project, and global data still defined depending on the call. That way you could get the names of deleted programs that still have data defined and delete the data.