It looks like you're new here. If you want to get involved, click one of these buttons!
This is a feature I would like to see in a future version of Codea: A way to keep code that can be shared between projects.
I have a handful of .lua files I like to include in ever project I start. Some utility classes and functions I have created, MiddleClass, A crude UI library I created for Codea, etc. These files either never change, or I want the changes to be shared between all projects that use them.
So I would like it if there were a "common" or "library" project that would represent a body of lua files that would be shared with all Codea projects.
Comments
Saveglobaldata() is your freind
I have a library of personal functions as well, like coin(), sideof(), slicerender()... I just save them with saveglobaldata
@KMEB That is an interesting idea. Its got a number of downsides, but at least it works today.
That is pretty clever. I remember reading in a previous thread that code sharing between projects was on the radar, but this should do in the meantime.
@JockM my plan for this is to allow you to select any number of other projects as dependent projects — this would happen from the + button used to add new files. They would get loaded before your project runs.
If you then changed the dependent (library) project - would that be everywhere? Ie. are we copying, or pointing? And how would that work with the current cut-and-paste regime imposed by apple?
@Simeon perfect, that will do nicely
@Bortels it would just be a weak reference. An instruction to "Load the project with this name before running the current one".
Please, please, please do this!
Yes! This! This would make things a ton easier when incorporating some of the libraries I've been writing. They are starting to get fairly large when it comes to the number of classes I am using.
Something I saw somewhere:
@TheRogueBatcher - please start a new discussion rather than resurrecting 18 month old threads. (I know you were trying to be helpful, it's just that it is confusing to suddenly see such old discussions resurfacing).
If you include code, it will format correctly if you put three ~ before and after it, as I've done above. You also seem to have double posted, I'll delete the second post, if that's the case.
Finally, on this topic, Codea now has the ability to set dependencies to other projects, allowing you to share code between your projects. I think this is what was being discussed.