July 12, 2006
Lars Ivar Igesund wrote:
> Well, who did ever say that was a good idea, everything public by
> default? ;)

I did <g>.
July 12, 2006
Bill Baxter wrote:
> All I've heard in this discussion is proponents for these two changes, with the
> exception of Walter, of course.

There are a lot more D users than people who post here. I hear from them when I make a change that breaks their code, and they are rarely happy about it.
July 12, 2006
Derek Parnell wrote:
> On Wed, 12 Jul 2006 09:25:50 +0300, Georg Wrede wrote:
>>Regan Heath wrote:
>>
>>>import std.stdio as io;
>>>
>>>writefln("");    //error
>>>io.writefln(""); //ok
>>>
>>>in that this syntax allows the compiler to _not_ import into the  2ndary namespace and _instead_ into the named one, instead of doing both,  which is what appears does/will happen using 'alias'. I prefer this.
>>
>>Exactly!
>>
>>And this is *very important*.
> 
> 
> Why?

Several reasons.

 - The syntax looks explicit enough for the programmer to honestly assume that the only import is to the specified namespace.

 - Doing stuff behind the back is Bad Manners.

 - Importing to both would not alleviate the problem of namespace pollution.

 - Who'd understand the error messages about name clashes?

 - Any outsider would really consider this a grave beginner bug from the compiler writer.
July 12, 2006
On Wed, 12 Jul 2006 00:39:31 -0700, Walter Bright wrote:

> Bill Baxter wrote:
>> All I've heard in this discussion is proponents for these two changes, with the exception of Walter, of course.
> 
> There are a lot more D users than people who post here. I hear from them when I make a change that breaks their code, and they are rarely happy about it.

I can understand that. If I may be so bold as to say that you really ought to telegraph your intentions in detail before implementing them. Especially stuff which has the potential to break otherwise conformant code.

So ... what are you planning for imports and when might we see any changes?

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
12/07/2006 5:47:28 PM
July 12, 2006
Sean Kelly wrote:
> Not to get off topic, but that was a pretty hot issue and a lot of ideas were thrown around (as with this now).  I preferred the old syntax as well but wasn't willing to press the issue and things heated up.  And by the end of the discussion I don't think there was any clear consensus on what the changes should be.  I suspect this is why everyone was a bit surprised at the changes--any changes would have been at least a bit surprising.  I think what was lacking there was public evidence of any sort of decision.  At some point things just sort of died down and the next release contained a new implementation built from the conclusions you had drawn (accurate or no).  It would have helped immensely if, before making any changes, there had been a post outlining your conclusions and the changes you intended to make.  This would inevitably have sparked more discussion, but if it's a change you don't find particularly appealing anyway, I think it's worth making sure the dissenters have no right to complain after the fact :-)

I was quite surprised at the negative reaction to it from the people who suggested those changes.

> I think part of the problem is that large public forums doesn't lend themselves well to directed discussion, and the general trend in d.D, simply because of the large number of participants, is that any such discussion be comes frustratingly garbled.  You don't reply to every person who feels they said something deserving a response, and people begin to feel they're being deliberately ignored.  As Kris started this discussion in the first place, I suspect it's particularly frustrating to him that it suffer the fate of all such discussions here, and that his posts are some of those not offered considered responses.  Not to mention that this is an issue he appears to have spent a tremendous amount of time thinking about, and obviously feels quite strongly about as well.

I spent about 8 hours yesterday writing posts here. There's only so much I can do - especially since every post I write tends to generate a dozen responses.


> Assuming you're considering any change as a result of this conversation, perhaps the details could be settled explicitly, either here or in a separate thread?  I think everyone has said their piece at this point, and it would probably help everyone cool down a bit if things wrapped up with a suggested plan, even if the plan is to not change a thing for reasons X Y and Z.

I agree with waiting until things cool down.
July 12, 2006
Walter Bright wrote:

> Lars Ivar Igesund wrote:
>> Well, who did ever say that was a good idea, everything public by default? ;)
> 
> I did <g>.

Right :) I don't agree.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
July 12, 2006
On Wed, 12 Jul 2006 10:45:09 +0300, Georg Wrede wrote:

> Derek Parnell wrote:
>> On Wed, 12 Jul 2006 09:25:50 +0300, Georg Wrede wrote:
>>>Regan Heath wrote:
>>>
>>>>import std.stdio as io;
>>>>
>>>>writefln("");    //error
>>>>io.writefln(""); //ok
>>>>
>>>>in that this syntax allows the compiler to _not_ import into the 2ndary namespace and _instead_ into the named one, instead of doing both,  which is what appears does/will happen using 'alias'. I prefer this.
>>>
>>>Exactly!
>>>
>>>And this is *very important*.
>> 
>> Why?
> 
> Several reasons.
> 
>   - The syntax looks explicit enough for the programmer to honestly
> assume that the only import is to the specified namespace.

Hmmm ... I read "import std.stdio as io" as saying import std.stdio and from here on in the text of this module, when 'io' is used assume that 'std.stdio' was meant instead. In other words, I see this as saying that 'io' is an optional, alternative reference to 'std.stdio'. I don't read 'io' as being a namespace, but just an alias for std.stdio.

However if the synatx was "import std.stdio into io" that would make me think of 'io' as a namespace into which the stuff in std.stdio was placed for look up.

>   - Doing stuff behind the back is Bad Manners.

Automatically looking into the imported files for matching names is bad manners? Not for me it isn't. In fact it seems down right neighbourly.

>   - Importing to both would not alleviate the problem of namespace
> pollution.

And by "namespace pollution" you are referring to the increased possibility of duplicating names in the same lookup scope level, right? Of course it wouldn't but that's not what it was trying to do.

>   - Who'd understand the error messages about name clashes?

Messages like ...

  myfile(44): Cannot find an accessible matching function 'foo'.

>   - Any outsider would really consider this a grave beginner bug from
> the compiler writer.

I don't think there is much evidence of that yet, but may by I'm not an "outsider" (read?: experienced C++/C#/Java user?). In any case, if it's behaviour is correctly documented one can simply get educated instead of assuming a beginner compiler writer.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
12/07/2006 5:54:32 PM
July 12, 2006
On Wed, 12 Jul 2006 01:00:32 -0700, Walter Bright wrote:

> Sean Kelly wrote:
>> Not to get off topic, but that was a pretty hot issue and a lot of ideas were thrown around (as with this now).  I preferred the old syntax as well but wasn't willing to press the issue and things heated up.  And by the end of the discussion I don't think there was any clear consensus on what the changes should be.  I suspect this is why everyone was a bit surprised at the changes--any changes would have been at least a bit surprising.  I think what was lacking there was public evidence of any sort of decision.  At some point things just sort of died down and the next release contained a new implementation built from the conclusions you had drawn (accurate or no).  It would have helped immensely if, before making any changes, there had been a post outlining your conclusions and the changes you intended to make.  This would inevitably have sparked more discussion, but if it's a change you don't find particularly appealing anyway, I think it's worth making sure the dissenters have no right to complain after the fact :-)

Yes Sean, I think you have raised good points there and I tend to agree with them.

> I was quite surprised at the negative reaction to it from the people who suggested those changes.

Just to clarify, not *all* people who suggested those changes that you implemented were upset by you doing that. I use AAs a lot and I love the changes you made to them.

> I spent about 8 hours yesterday writing posts here. There's only so much I can do - especially since every post I write tends to generate a dozen responses.

But it has to be better listening to your valued clients and meeting their needs than quietly, but surprisingly, implementing stuff that the clients weren't interested in or in a manner that troubled them. Time invested in reconnaissance is never wasted.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
12/07/2006 6:17:56 PM
July 12, 2006
kris wrote:
> Personally, I have to wonder what compelling reason there is to continue ploughing so much effort into helping make D a success, behind the scenes, when it appears to have so little value in your eyes.

Language design is hardly cut and dried. There is rarely a right and a wrong answer. There are only benefits and costs, and those vary from application to application, and peoples' opinions of them vary as well.

You and I have different opinions about how certain things should work. Nothing more should be read into it than that.
July 12, 2006
David Medlock wrote:
> Walter Bright wrote:
>> How imports work is that first a name is searched for in the current namespace. If it is not found, then it is looked for in the import list. If it is found uniquely among the imports, then that is used. If it is in more than one import, an error occurs:
> 
> That is not how aliases currently work, just a friendly reminder.

True, because that's how imports work, not aliases. But I'm not sure what's on your mind with that statement?