Better script sharing - function.bind

So, from what I understand, this may be a limitation with Moonsharp apparently, but it's worth asking.

there are two things that I want to showcase/request.
- I would love to be able to alter functions of an object on another object's script.
- in so doing, being able to bind the "self" definition to another object. I come from a javascript background and it's VERY useful to be able to define what "this" (in lua that's "self") is when you're assigning a function.

Code:

function onCollideEnter(obj)
local newPickupFunc = function(player)
print(player.color)
self.onPickup = nil -- set the onPickupEvent on the owner of this function (bound to 'obj' below) to nothing
end
obj.onPickup = newPickupFunc.bind(obj) -- assign the function to the onPickup event while defining what 'self' within that function be 'obj'
end

The fact that functions cannot be shared between scripts isn't really a moonscript limitation, however it would have to be specially handled, as the closure would have to be dynamically built whenever we were handing it over. There is no right way to do this, so I dont blame the devs from avoiding it.

If you want events to change during the game, I would recommend handling everything in global - Make an Object class of your own in the style of an eventemitter, then emit on it using the onObjectPickup event in global. For the collision events, you can place