From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam To: <9fans@cse.psu.edu> Subject: Re: [9fans] useful language extension, or no? In-Reply-To: <624e56d4bc299dc1b5658d3a56c32c25@plan9.bell-labs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Tue, 16 Jul 2002 11:31:41 -0400 Topicbox-Message-UUID: cdb6ef90-eaca-11e9-9e20-41e7f4b1d025 Ok, I'll bite and play devil's advocate. What about the promotion of a structure from itself to one of its members in a function call simply because it makes locking a structure easier? Surely passing in a pointer to a function and having the in-func pointer completely different violates some standard of programming languages. Why was it worthwhile to change the language in this respect, for the idiom of "always having to make sure the lock is the first item in the structure for pointer coersion is a pain?" Sam On Tue, 16 Jul 2002, rob pike, esq. wrote: > > Suppose I'm not saying "why," but "why not." IMO it's cleaner and > > quite possibly more efficient (without getting into a usec argument, > > please). Do you disagree? > > Yes. The benefit is minor, too small to justify changing the language. > You're trying to formalize an idiom; just using the idiom suits me fine. > > The type inclusion feature, I think, did a lot more, since it trigged type > conversion and promotion: a much bigger deal. > > -rob >