[Xotcl] For anyone who wants their XOTcl instantiation safer

Gustaf Neumann neumann at wu-wien.ac.at
Fri Aug 6 09:09:34 CEST 2010


Am 05.08.10 23:28, schrieb Kristoffer Lawson:
> On 5 Aug 2010, at 20:59, Gustaf Neumann wrote:
>
>    
>> you have lost all means to pass a value for "animal", except when you
>> pass it to init (i know "new-with" is different). One can can certainly
>> say, the first argument passed to init is the "animal", then default
>> handling is ugly (in the general case) and you have to deal with ugly
>> positional arguments. This technique does not scale:
>> What, if one inherits additional parameters from a superclass
>> (of Foo), or when the superclass is extended? If every argument
>> to init corresponds to a parameter, one has to extend the signature
>> of the involved init methods. Adding arguments is not really an
>> option when the parameters are provided via mixins, or when
>> the object-class and class-class relationships can changed dynamically.
>> Another issue is passing arguments of init to superclasses via next.
>> If the inits of the superclasses have different signatures, the
>> code becomes error prone.
>>      
> Gustaf, I'm not sure what you're getting at as that is exactly what [new-with] is for. With that I can do parameterisation outside of [init].
please read my mailer slower. i have excplicitely refered to the 
consequences of "new", not "new-with".

> So I use [new] when I do not need parameterisation
well, some other might wonder how to achieve it.
> (so I don't have to give an empty argument for [new-with]),
in the new syntax of xotcl, the scripted initialization is optional, so 
there is not need for
an empty argument.
>> *Class create*  Stack {
>>   ...
>> }
>>      
> Hm, am I right in assuming the *s are just something funny when you copy-pasted from your editor, or is the plan actually to have it look like that? I can feel a few eyebrows being raised if so! :-)
>    
This was a cut&paste from ff4b2 to thunderbird, from an example of the 
migration guide.
The pasted text was still ok, but it seems that upon send thunderbird 
used *...* to indicate
bold...

-gustaf neumann


More information about the Xotcl mailing list