About Go, D module naming

"Jérôme M. Berger" jeberger at free.fr
Sat Dec 22 01:29:24 PST 2012


Walter Bright wrote:
> On 12/21/2012 11:23 PM, Jonathan M Davis wrote:
>> But we _want_ that. The fact that inaccessible functions are even
>> considered
>> in overload sets is horrible. That's precisely the problem. No
>> inaccessible
>> functions should be in overload sets. Otherwise, simply adding a private
>> function to a module can break code elsewhere. I don't see _any_
>> benefit in
>> having inaccessible functions be in overload sets. It's leaking
>> implementation
>> details outside of the scope that they're in and breaking code
>> elsewhere when
>> changes are made. What do you think is so desirable about having
>> inaccessible
>> functions in overload sets?
> 
> 
> It's that way in C++ mainly so that it doesn't make the already complex
> overloading system even more so. And in 25 years of working with C++,
> I've never seen this make anyone's list of horrible things about C++.
> 
	Actually, it is *not* that way in C++ for "module-private"
functions. I know that C++ doesn't have true "modules" and a
fortiori true "module-private" functions (or types or variables),
but the C++ equivalent of module-private is file static (or the
anonymous namespace) and those do *not* make it into the overload
set and cannot affect user code.

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121222/df295940/attachment.pgp>


More information about the Digitalmars-d mailing list