Multiple inheritance allows to specify that one  class is a subclass of several other classes.

Some languages allow multiple inheritance for arbitrary classes,   others restrict it to interfaces,   some don't allow it at all.



Task

Write two classes (or interfaces) Camera and MobilePhone,   then write a class CameraPhone which is both a Camera and a MobilePhone.

There is no need to implement any functions for those classes.




coclass 'Camera'
 
create=: verb define
  NB. creation-specifics for a camera go here
)
 
destroy=: codestroy
 
NB. additional camera methods go here
 
coclass 'MobilePhone'
 
create=: verb define
  NB. creation-specifics for a mobile phone go here
)
 
destroy=: codestroy
 
NB. additional phone methods go here
 
coclass 'CameraPhone'
coinsert 'Camera MobilePhone'
 
create=: verb define
  create_Camera_ f. y
  create_MobilePhone_ f. y
  NB. creation details specific to a camera phone go here
)
 
destroy=: codestroy 
 
NB. additional camera-phone methods go here