April 28, 2014
On Saturday, 26 April 2014 at 18:11:18 UTC, Walter Bright wrote:
> On 4/26/2014 4:57 AM, Dicebot wrote:
>> Necessity to define namespaces for
>> interfacing with C++ must not result in usage of namespaces of pure D code.
>
> Why?
>
> I don't see much of any use for namespaces in pure D code, though I could be surprised.

If namespaces would give some astounding advantage, we would have already seen it in C++. We don't want D to become another C++ with millions of ways of doing the same thing, do we? Modules have served us well enough.

Put another way, we don't need namespaces "in the D language", but we do need the ability to call C++ as easily as if they were "in the D language". From the above comments, it looks like it would be trivial.
April 28, 2014
On 4/28/14, Dicebot via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> I was even going to write an objection to my own idea precisely quoting your comment in that thread but got too lazy :) Well, this stuff is really obvious, no wonders here.

I don't know, I'm reconsidering right now that maybe forcing static imports could be a good thing in some contexts.
April 28, 2014
On Saturday, 26 April 2014 at 20:16:34 UTC, Walter Bright wrote:
> On 4/26/2014 12:27 PM, Daniel Murphy wrote:
>> We already have a feature to manage conflicts and organisation in D code -
>> modules!
>
> True. But what D doesn't have is a global namespace. I don't propose one for D, but C++ symbols may appear in the C++ global namespace, or in a C++ namespace. So using D modules to represent C++ namespaces has a problem.

extern(C++, facebook::folly) as bigcorp.whim;

April 28, 2014
On 4/28/14, 1:15 AM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:ljjmi6$16nk$1@digitalmars.com...
>
>> Ok, I saw that, and replied to it earlier this thread.
>
> Yes, but you seemed to miss the point.
>
>> Having a pragma to just add mangling doesn't deal with problems like:
>>
>>      namespace N { int foo(); }
>>      namespace M { int foo(); }
>>
>>      foo();  // how to specify which one gets called?
>>
>> I.e. only addressing name mangling does not scale. Need actual scopes,
>> too.
>
> We have MODULES to deal with conflicts.  We do NOT need to add a new
> type of scope to D just for C++ namespaces.
>
> You deal with conflicts the SAME WAY you do with normal symbols - put
> them in different modules.
>
> This is more powerful, because it doesn't force you to match the
> namespace layout in your D code.

I've missed that proposal, and couldn't find browsing through your recent posts. Could you please send a link, thanks. -- Andrei
April 28, 2014
On Mon, 28 Apr 2014 17:19:16 +0200
Andrej Mitrovic via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> On 4/28/14, Dicebot via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> > Yeah, it is just a random idea I have just had.
> 
> I'm afraid you're 7 years too late for that patent. :P
> 
> https://issues.dlang.org/show_bug.cgi?id=1297

I find it rather funny that bugzilla still labels it as "new." :)

But that's bugzilla for you.

- Jonathan M Davis
April 28, 2014
"Andrei Alexandrescu"  wrote in message news:ljm022$575$1@digitalmars.com...

> I've missed that proposal, and couldn't find browsing through your recent posts. Could you please send a link, thanks. -- Andrei

Pretty sure you saw it.

http://forum.dlang.org/post/lhjg4o$k82$1@digitalmars.com 

April 28, 2014
On 4/28/14, 10:56 AM, Daniel Murphy wrote:
> "Andrei Alexandrescu"  wrote in message
> news:ljm022$575$1@digitalmars.com...
>
>> I've missed that proposal, and couldn't find browsing through your
>> recent posts. Could you please send a link, thanks. -- Andrei
>
> Pretty sure you saw it.
>
> http://forum.dlang.org/post/lhjg4o$k82$1@digitalmars.com

Thanks. Isn't it unprecedented for pragmas to introduce scopes and to be un-ignorable? -- Andrei
April 29, 2014
"Andrei Alexandrescu"  wrote in message news:ljm83i$d6i$1@digitalmars.com...

> Thanks. Isn't it unprecedented for pragmas to introduce scopes and to be un-ignorable? -- Andrei

(I'll assume you mean introduce scopes as in the {} syntax, not the way Walter's proposal introduces scopes)

No, pragma(mangle) works in a very similar way, so there is a precedent.  It also serves a very similar purpose and can actually accomplish the same things, cpp_mangle would just be a more specialized tool.

Pragmas can be used with all three attribute syntaxes:

Single declaration:
pragma(blah)
int x;

Block:
pragma(blah)
{
   int x;
}

Label:
pragma(blah):
int x; 

2 3 4 5 6 7 8 9 10 11 12
Next ›   Last »