Method Overloading #727
-
I am working on a system for Mekanism to allow me to more easily define methods in am abstracted method to allow me to easily support both ComputerCraft and OpenComputers (if it ever updates). While working on adding in some extra validation on our end about method collisions and "dynamically" fixing them by just pretending they have a different name than they actually do; for example: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Personal opinion incoming, but IMO the easiest solution here is to not go building your own abstraction layer right now, and just use Anyway, onto the actual question: Lua doesn't really have a notion of methods or method overloading. As far as its concerned, ComputerCraft is the same - fundamentally all functions just accept a list of In the cases where we do need to do "overloading", we just fallback to the TLDR: No methods, no overloading. Just roll your own! |
Beta Was this translation helpful? Give feedback.
Personal opinion incoming, but IMO the easiest solution here is to not go building your own abstraction layer right now, and just use
@LuaFunction
. There's no obvious timeline for when OC is going to update (the's a Fabric port in progress, but not much use to you :p), and until then you're just creating work for yourself.Anyway, onto the actual question:
Lua doesn't really have a notion of methods or method overloading. As far as its concerned,
test
is a single function and, like all functions,…