Practical use case of Pony's `_final` finaliser method

80 Views Asked by At

What is a practical use case (besides interfacing with C code via FFI or things like that) of Pony's finaliser method inside a class? Pony's documentation specifies that by default the method signature must be fun _final() with receiver reference capability of a box, and no messaging can happen. That seems to be quite restrictive and prevents most common use cases in Java-style finalize methods, like debugging (determining when the object is GC'd) or modifying field values. Is there a concise practical example of what a typical finaliser use case will be like (except for interfacing with code written in another language, in that case, I get it)?

0

There are 0 best solutions below