The changes in the latest beta in OOP, as shown in all 
the system files, were successful example of refectoring.

However, there are some raw spots.

   -:&(5!:5)/ ;:'cocurrent coclass'
1

So one of them is either redandant, or could
be doing something more useful.

cocurrent is a primitive, so it cannot be
removed or redefined, extended etc.

But coclass is a candidate for improvement. I like the ideas 
that Raul summarized below. Locale is treated 
as a special additional parameter, thus freeing 
the x. for future possible uses, or just making 
it neat with left argument.

Also Raul shows that during declaration of a class
it is possible to indicate the inheritance,
as the parameter to class. In my openion,
it is better, than doing a separate coinsert for
a number of reasons:

 - coinsert is a low-level verb which is better to
   left for finer advanced control and out of regular 
   usage pattern

 - coinsert name is implementation-specific and
   bares little suggestion for users familiar
   with OOP in other languages

 - inheriting within the same clause as declaring
   a class, on the other hand, is a familiar practice

Finally, since we are making the "making release"
change, and will have to change the code albeit trivially,
it might as well be done (I hate to use "right" here)
with a greater sense of completeness.


Also, in most OO languages there is default constructor
and destructor, typically inherited from the root class.
So I suggest permanently put in 'z' locale:
  create_z_=: ]
  destroy_z_=: codestroy



--- "Miller, Raul D" <[EMAIL PROTECTED]> wrote:

> bill lam wrote:
> > Is it guarantee that at any point, {.copath 18!:5'' being the class 
> > from which the object is conew-ed from? (assuming the object is 
> > indeed conew-ed from something)
> 
> That seems to be guaranteed when create is being executed by conew.
> 
> > >>BTW is "cocurrent" now redundant in J601?
> > > 
> > > I find uses for it, but maybe for your purposes it is redundant.
> 
> > Eric said coextend=: coinsert is extra baggage. By the same token, 
> > so is cocurrent=: coclass
> 
> I don't use coclass for oo programming.
> 
> I use:
> class_z_=:3 :0
>  coinsert y
>  18!:4 coname''
> )
> new_z_=:3 :0
>  o=. cocreate''
>  ((,copath)coname'') copath o
>  this__o=: o
>  create__o y
>  o
> )
> create_z_=: ]
> destroy_z_=: codestroy bind ''
> 
> Usage example:
>    class_example_''
>    obj=: new_example_''
>    destroy_obj_''
> 
> I've not nailed down all the reasons yet, but I find myself far
> more comfortable with this notation than with coclass.
> 
> Nevertheless, this approach works with classes which were 
> implemented using coclass.
> 
> -- 
> Raul
> 
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to