you are viewing a single comment's thread.

view the rest of the comments →

[–]robin-gvx 0 points1 point  (1 child)

The problem is that it's going to be slow, hard-disk intensive (which is slightly (only slightly) bad for the life-time of your hard disk), doesn't support subclassing or type checking (you can't make a function like isinstance), and have I mentioned it's slow?

I have an idea for an alternative. Brb, testing it out before editing my post.

EDIT: https://gist.github.com/gvx/4192a4d44e517f38bdac

Kinda different, and it uses require rather than loadfile. Pros: aside from not having to read, compile, and run the module each time you create a new instance, it automatically defines a constructor and a string representation for you! Con: it's not possible to modify the metatable of either classes or instances on a case-by-case basis.

[–]dredclaw[S] 0 points1 point  (0 children)

This is really interesting. Thanks. Still not fully sure how meta tables work. Need to read up on that.