[bitc-dev] Objects without subtypes
Jonathan S. Shapiro
shap at eros-os.com
Fri Oct 17 12:01:07 CDT 2008
On Fri, 2008-10-17 at 09:44 -0700, Eric Northup wrote:
> > What we now have in mind is to introduce a new constraint:
> >
> > (has-field 'a name 'b)
> >
> I don't see how you would be able to get "protected" fields out of
> this. Perhaps that's fine (I've seen it mis-used quite often), but just
> thought I'd mention it.
1. The C++ notion of public/private/protected is a kludge. Protected
isn't meaningful in the absence of inheritance, which BitC does not
propose to have.
2. Private/protected are not true encapsulation, in the sense that the
types are exposed. This is why #include requirements proliferate in
C++.
3. It isn't the goal here to support that concept.
> The module system might be a better way to perform that kind of
> encapsulation anyway. Is there a module equivalent of "friend"?
That would violate the entire point of a module!
shap
More information about the bitc-dev
mailing list