[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 21 13:58:54 1994 
Subject:Re: C++ ideas 
From:Adrian John Howard 
Volume-ID:940722.02 

[Jonathan said]
> > 2) Non-virtual member functions (methods) (these are not the same as
> > static member functions - which are like class variables). These look
> > like a restriction, because you can't mess with them in a derived class.
> > They are probably as irritating as using top-level lvars in a library in
> > pop11, but enable the class library programmer to write secure code
> > which the person using the library can't screw up. I think they are a
> > cleaner way to do it than the pop11 way.

[Steve said]
> My comment on this is that lexical slots work in exactly this fashion.
> Perhaps I've missed the point here?
>
> A key design decision was to use the Pop11 name space control mechanisms
> rather than invent new, wacky ones.  This was motivated by looking at
> the name space control mechanisms of C++.  I feel that the ability to
> create "hidden" slots by simply declaring them as "lvars" is one of the
> most elegant consequences of the approach I chose.

.... and it works fine until the mean 'n' nasty user -include-s the
library :-)

However, I agree that Steve made the right decision in keeping Pop-11's
name space control mechanisms. The level of integration between Pop-11
and ObjectClass is wonderful. However, I think everyone agrees that
Pop-11's namespace control mechanisms needs overhauling (I want proper
abstract data-types... and does *anyone* like sections?)

[Steve said]
> The last two points (destructors and stack-allocated objects) relate
> to memory management issues.  I shall not comment beyond stating that
> C & C++ both suffer profoundly from the lack of automatic memory
> management.  As a consequence, these points seem very weak.

Actually, I think destructors would be quite a cute addition to Pop-11.
Keys would have an associated -class_destructor-, and if this is
procedure it gets assign to -sys_destroy_action- whenever an object is
constructed. (actually, you'd need some kind of flag in -conskey- to
decide whether the destroy action is associated with
-sys_destroy_action- or -sys_process_destroy_action-).

Adrian

aids (adrianh@cogs.susx.ac.uk)  ObDisclamer: Poplog used to pay my wages
Phone: +44 (0)273 678367  URL: http://www.cogs.susx.ac.uk/users/adrianh/