Hey yall!
I'm thinking about adding a concept for library builders into Lowerdash - "Resources"
I wanted to see if users/the community found this understandable:
Resources would let you declare a Module a provider for a type of Resource with certain properties.
You could then declare a different Module a consumer of that Resource - Adding references to a new Resource instance's properties on each new instance of the consumer.
Example:
Module PhysManager RES Body: { X: 0, Y: 0, W: 16, H: 16, VX: 0, VY: 0, M: 100, P: 1, V: 100 }, Ray: { NOT$:"USED" } ... Module PhysBody REF PhysManager Body ... VAR E$ = new("PhysBody") PhysManager_update ?_(E$,"X");",";_(E$,"Y")After compiling this code: PhysManager has generated methods addBody and delBody These methods operate on a generated ID, in this case BodyID. PhysManager has generated VARs X[], Y[]... for direct access to every Resource instance it manages without any lookup cost Every instance of the PhysBody module has generated getters and setters for every property on the Body Resource A MEM BodyId is set using addBody on the PhysBody instance in its constructor. Whew Lad! Now, is this feature understandable? What keywords are best for this functionality? REF and RES are pretty common... and similar... How do I avoid making this look like JSON and objects? EDIT: Fixed the example. I just realized, I might want to do the linking backwards so that the property declaration is on the REF. Does the provider even have to know its being monkey patched? Well except that it needs to know about all the variables... EDIT2: USE CASE: I'm using this right now for Physics entities - to do the whole update in one DEF block - and want to use it for Events on Actors - again to do event bubbling in one block.