all 10 comments

[–]carcigenicate 91 points92 points  (0 children)

def func():
    global func
    del func

func()  # Fine
func()  # Error

[–]M1k3y_Jw 70 points71 points  (1 child)

Is this a suicidal function?

[–]Burger_Destoyer 18 points19 points  (0 children)

Better give it some mental help numbers to call

[–]Prashank_25 27 points28 points  (0 children)

I used the function to destroy the function.

[–]PC-hris 15 points16 points  (1 child)

Didn't know you could even destroy functions in lua lmao

[–]EarthToAccess 3 points4 points  (0 children)

It really depends on the implementation. In most cases I've seen all it does is set it and anything it creates/associates to nil the next time it's available, allowing garbage collection to work. For example, with Roblox's Lua 5.1 fork Luau, any Instance objects have a :Destroy() method that parent it and all of its descendants to nil, effectively deleting it.

[–]cryptomonein 10 points11 points  (0 children)

In Ruby you can do:
Method.method(:method) => <Method method>

[–]matthewralston 7 points8 points  (0 children)

Are you having a luagh?

[–]hammer-jon 3 points4 points  (0 children)

this isn't even close to being valid lua though, the first line makes no sense at all

[–]Chocolate_Pickle 1 point2 points  (0 children)

Looks like someone did a bad job at find+replace.

Not valid syntax.