View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] Asserts off/on

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Sat, 15 Jul 2006 17:46:25 +0300

On 15 Jul 2006, at 17:21, Gustaf Neumann wrote:

> Kristoffer Lawson schrieb:
>>
>> Except that this only works 'afterwards'. So it doesn't actually
>> help, as I'd still have to apply it after I create objects etc.
> i thought you want to turn on checking for all objects (which means
> existing objects).
>> when really I just want to turn it on at the top of the
>> application and leave it at that.
>>
>> For the moment I managed this with a filter that is called every
>> time an object is initialised, but I would imagine this the kind
>> of thing that should be handled elegantly by the XOTcl core?
> Why a filter?

Hm, well, it was the first thing that came to mind :-) And easy to do
anyway.

> in order to turn an checking for objects as you create these, you
> might
> use something like the following:
>
> Object instmixin [Class new -instproc init args {my check all;
> next}]

Yeah, giving that some thought, that should work too.

But would it be useful to have this kind of functionality in the core
too?

Something like:

Class instcheck all

            / http://www.fishpool.com/~setok/