Callwrapper |
|
Library to assist in wrapping function calls across object types [More] |
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Alathon.Callwrapper##version=1 Emulator users, in the BYOND pager go to File | Open Location and enter this URL:byond://Alathon.Callwrapper##version=1 |
Callwrapper provides two objects:
The callObject object, for calling a specific function belonging to an object. The callInterface object, for providing access to up to many different functions belonging to an object. The objects make sure that the function exists, and the callInterface can automatically guess what functions should be callable, based on their name (Rather, it will not allow you to call functions that are considered private). This library stems from the ideas discussed in the DevTalk article, Design in BYOND: Interfaces?. Demo code is available in demo.dm, the library can be run by itself to run the demo code. There is currently no documentation other than the code shown in demo.dm - That will change in the Near Future(tm). |
Copyright © 2024 BYOND Software.
All rights reserved.
I'm also not sure about the enforcement of public and private members. The naming convention is ok, but I think self-enforcement would work better. You can just search your code for ".__" to find places where you reference a private member from outside the object. Valid references don't need to specify src.__something, they can just be __something, invalid references would have to be of the form object.__something.