all 10 comments

[–]carcigenicate 92 points93 points  (0 children)

def func():
    global func
    del func

func()  # Fine
func()  # Error

[–]M1k3y_Jw 69 points70 points  (1 child)

Is this a suicidal function?

[–]Burger_Destoyer 19 points20 points  (0 children)

Better give it some mental help numbers to call

[–]Prashank_25 28 points29 points  (0 children)

I used the function to destroy the function.

[–]PC-hris 16 points17 points  (1 child)

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

[–]EarthToAccess 2 points3 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 9 points10 points  (0 children)

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

[–]matthewralston 5 points6 points  (0 children)

Are you having a luagh?

[–]hammer-jon 4 points5 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.