Anyway summing up my adhoc posts re the interface discussion ; Assuming we have interfaces without the implicit "this" , are they then not almost exactly like type classes ?
Though I think what we really want is simple interface declaration ( which is mapped to a type class) as a gentle introduction to type classes and this declaration should also be used to allow Bitc to map to OO libs and languages and may support implicit this if needed in v2. Should such interfaces and the struct always be reference types / boxed ? Im thinking yes (mainly for interop and to make things simple) and leave type classes on structs for advanced users. Interfaces can mimic inheritance especially since type classes help for setting up shared member functions and worst case it is not that difficult . This scheme creates quasi classes which can wrap several structs. Is the access mechanism fine enough eg public/private/internal ? Regarding modules and my comments earlier ,what I meant to say was , we use export at the moment as our way of data hiding instead of private , my question is for good practice should export export an interface ( it would keep the list in one place and require only a single exports) ? We can use modules to do the data hiding but are modules sufficiently fine granularity for data hiding ? eg Capabilities ? Can we prevent manipulation on structs outside the module but still reference them ? It looks like it will all come together nicely though I normally don't believe anything till I see some code ( but no inheritance however inheritance to interfaces is pretty easy to do IF the inheritance has been well done) Anyway I will shut up now..Just caught my interest. Ben
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
