[26 Feb 2008] Class library files for creating classes in hollywood

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Dwayne

[26 Feb 2008] Class library files for creating classes in hollywood

Post by Dwayne »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 26 Feb 2008 23:29:01 +1100

Hi all,

I have created a folder called classlib and uploaded three files for people to look at and hopefully help to extend and bugtest.

It is an incomplete version of classlib.lua from lua-users.org/wiki and will aid in the creation of classes with inheritance in hollywood scripts.

It has a lot of debug output at the moment whilst as it is still being tested. I have yet to change function name with the p_ prefix so that conflicts won't occur. It uses a rudimentary include system so that the files aren't included twice (I think it works - seemed to for me). But would like advice or suggestions on whether this is good bad indifferent. Currently shared and normal inheritance is broken and I am still trying to track down the bugs hence the debugoutput.

There are three files in total.

1) classlib.hws - main file with all the heavy stuff
2) constants.hws - helper file required by classlib that will be useful for other projects. This also includes basic debug routines that help in error tracking.
3) account.hws - an example file of how to use the class library. This also has exampled of using two inherited classes of the base Account class as well as another that inherits using these two new classes. This is currently commented out and still requires further testing.

I have been working on this for the last few evenings and hoped to have it completed before I go on holidays for a week but alas my wife is dragging me kicking and screaming to rainy/sunny qld to Tangalooma dolphin resort. I hope people don't mind the files being posted and get some use out of it in its current form and I look forward to seeing what others can contribute to the project and whether they feel it is worthwhile.

Believe I am not a lua expert by any stretch of the imagination and any help to further this would be much appreciated. Most of it has been picked up by testing/trial and error and by setting up break watches in LuaEdit on the PC and comparing the output with the debugoutput on.

I will re-insert the comments back into the main code once I have completed testing.

Please let me know if you make any changes and send me updates or upload them to the group.

Regards,

Dwayne
User avatar
Clyde
Posts: 351
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

[26 Feb 2008] Re: Class library files for creating classes in hollywood

Post by Clyde »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 26 Feb 2008 12:54:40 -0000

Hi Dwayne,

wow, great that you did that! Once it is fully implemented maybe Andreas can use it in the official release? I am quite sure he is implementing this or a similar approach!?

Just one remark for now:
I have yet to change function name with the p_ prefix so that conflicts won't occur.
Well, I suggest not to use p_ but sth more related to your project like cl_ (for classlib) or so (like an own namespace for you lib). Maybe someone is already sth like p_build() and so on. I hope you know, what I mean. Just a suggestion.

Cheers, Micha
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
Locked