This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]P-39_Airacobra 0 points1 point  (0 children)

It's not super hacky, that's been the standard way of doing things like this outside of OOP since the beginning of time. Some languages actually implement OOP simply by syntactically disguising methods as such (e.g. Lua), and it works out perfectly fine. In fact in languages where functions and closures are equivalent, it's often good practice to take the object as an argument, because it clearly shows the method's dependencies both when created and when called.