Re: destructor

new topic     » goto parent     » topic index » view thread      » older message » newer message
SDPringle said...

A destructor system shouldn't need a bless() routine unless you want the interpreter to remember what a value is. In a static system. We need a way to connect the destructor to the type. Add a builtin: procedure register_destructor( integer tid, integer rid )

You can use a routine id of a type. The type gets attached. The parser could put the destructor routines in where variables go out of scope.

It's more than out of scope. It's when the reference count drops to zero. This requires it to be figured out at run time, not compile time.

SDPringle said...

So, what will it be? Virtual methods or static ones?

I don't know. I suspect that we may want both. It might be possible to automatically attach the destructor information any time we assign to a UDT with a destructor. But there might be cases where this isn't possible, and want to be able to attach the destructor.

Derek previously said that he had a proposal for this, but I haven't seen it yet, and I haven't thought through it enough to be able to say, otherwise. I'm currently working on doing this for built-in data, specifically regexes, which are always created in the back end, so it's not an issue.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu