On 12/2/2014 2:00 PM, H. S. Teoh via Digitalmars-d wrote:
4) This isn't the end of the story. There's also this lovely bug:
https://issues.dlang.org/show_bug.cgi?id=1238
which, as its number should tell you, has been around for a LONG time.
Executive summary:
// mymod.d
On 12/2/2014 2:00 PM, H. S. Teoh via Digitalmars-d wrote:
However, there are major issues with scoped imports currently,
that make this otherwise ideal solution less-than-ideal, which stem from
the way 'import' is implemented in D. When the compiler encounters an
'import' statement, what it
On Mon, Dec 08, 2014 at 12:34:07AM -0800, Walter Bright via Digitalmars-d wrote:
On 12/2/2014 2:00 PM, H. S. Teoh via Digitalmars-d wrote:
However, there are major issues with scoped imports currently,
that make this otherwise ideal solution less-than-ideal, which stem from
the way 'import' is
On 12/8/2014 7:52 AM, H. S. Teoh via Digitalmars-d wrote:
I realize that my understanding on the workings of dmd may not be quite
accurate, and I apologize for any inadvertent misrepresentations, but
the fact remains that the current behaviour of import is very
counterintuitive, and users will
On Mon, 08 Dec 2014 14:30:08 -0800
Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote:
The two-step lookup method, of current scope then imports in current scope,
is
misunderstood by nearly everyone.
this is the clear sign of the existing problem.
signature.asc
Description:
On 12/8/2014 7:34 PM, ketmar via Digitalmars-d wrote:
On Mon, 08 Dec 2014 14:30:08 -0800
Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote:
The two-step lookup method, of current scope then imports in current scope, is
misunderstood by nearly everyone.
this is the clear sign
On Mon, 08 Dec 2014 19:40:38 -0800
Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote:
On 12/8/2014 7:34 PM, ketmar via Digitalmars-d wrote:
On Mon, 08 Dec 2014 14:30:08 -0800
Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote:
The two-step lookup method, of
On 12/3/14 8:00 AM, H. S. Teoh via Digitalmars-d wrote:
I'm finding it harder and harder to accept Walter's stance that symbol
lookups should be kept simple and free from complications and convoluted
corner cases, etc.. Except that it is*already* full of convoluted
pitfalls and corner cases you
On 02/12/2014 22:00, H. S. Teoh via Digitalmars-d wrote:
Recently, in a bid to reduce the messy tangle that is the web of
interdependencies among Phobos modules, many module-scope imports have
been replaced with scoped imports. In addition to reducing gratuitous
dependencies (the scoped import
On Tuesday, 2 December 2014 at 22:02:23 UTC, H. S. Teoh via
Digitalmars-d wrote:
However, there are major issues with scoped imports currently,
that make this otherwise ideal solution less-than-ideal, which
stem from
the way 'import' is implemented in D. When the compiler
encounters an
On Wednesday, 3 December 2014 at 13:34:42 UTC, Jacob Carlborg
wrote:
On 2014-12-02 23:00, H. S. Teoh via Digitalmars-d wrote:
I'm finding it harder and harder to accept Walter's stance
that symbol
lookups should be kept simple and free from complications and
convoluted
corner cases, etc..
On Wed, Dec 03, 2014 at 02:10:52AM +0200, ketmar via Digitalmars-d wrote:
On Tue, 2 Dec 2014 15:55:34 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
Hmm... actually, this gives me an idea. What if we implement a
little syntactic sugar for this in the compiler? Say:
On 02.12.2014 23:00, H. S. Teoh via Digitalmars-d wrote:
4) This isn't the end of the story. There's also this lovely bug:
https://issues.dlang.org/show_bug.cgi?id=1238
which, as its number should tell you, has been around for a LONG time.
Executive summary:
// mymod.d
On Fri, Dec 05, 2014 at 12:25:49AM +0100, Rainer Schuetze via Digitalmars-d
wrote:
On 02.12.2014 23:00, H. S. Teoh via Digitalmars-d wrote:
4) This isn't the end of the story. There's also this lovely bug:
https://issues.dlang.org/show_bug.cgi?id=1238
which, as its number should
On Thu, 4 Dec 2014 14:15:22 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Wed, Dec 03, 2014 at 02:10:52AM +0200, ketmar via Digitalmars-d wrote:
On Tue, 2 Dec 2014 15:55:34 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
Hmm... actually,
On Thu, 4 Dec 2014 14:15:22 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Wed, Dec 03, 2014 at 02:10:52AM +0200, ketmar via Digitalmars-d wrote:
On Tue, 2 Dec 2014 15:55:34 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
Hmm... actually,
module base;
class Base
{
import std.conv;
}
module derived;
import base;
import std.stdio;
string text = 123;
class Derived : Base
{
static void foo()
{
writeln(text);
}
}
void main()
{
Derived.foo();
}
This prints an empty line!
My
On 12/5/2014 10:04 AM, ketmar via Digitalmars-d wrote:
On Thu, 4 Dec 2014 14:15:22 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
OTOH, Kenji has a different solution already in PR form:
https://github.com/D-Programming-Language/dmd/pull/3407
Static, renamed,
On Tuesday, 2 December 2014 at 22:02:23 UTC, H. S. Teoh via
Digitalmars-d wrote:
I wish we would just acknowledge that the current symbol lookup
/ import rules
(or at least the implementation thereof) are inadequate, and
find a
clean solution to this long-standing issue, instead of hoping
On Tuesday, 2 December 2014 at 22:02:23 UTC, H. S. Teoh via
Digitalmars-d wrote:
2) OK, so the conclusion is that unqualified scoped imports are
dangerous, right? Alright, let's see what happens when we use
qualified
imports:
// mod.d
module mod;
struct S {
On 2014-12-02 23:00, H. S. Teoh via Digitalmars-d wrote:
I'm finding it harder and harder to accept Walter's stance that symbol
lookups should be kept simple and free from complications and convoluted
corner cases, etc.. Except that it is *already* full of convoluted
pitfalls and corner cases
On 12/03/2014 12:55 AM, H. S. Teoh via Digitalmars-d wrote:
struct S {
static import std.format;
alias format = std.format.format;
// ^^^ the above line is what makes s.format() break.
}
It's equivalent to
private alias
Recently, in a bid to reduce the messy tangle that is the web of
interdependencies among Phobos modules, many module-scope imports have
been replaced with scoped imports. In addition to reducing gratuitous
dependencies (the scoped import is not processed in a template body
until the template is
This whole thing is a huge hole in D that needs to be fixed (it
may even be necessary to consider it higher priority than the
current C++ and GC). As it works currently, I'd go as far as to
say that almost every addition to Phobos must be considered a
breaking change for these reasons. Given
On Tue, 2 Dec 2014 14:00:09 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
// mymod.d
module mymod;
struct S {
// Now everyone is happy, right...?
import std.range : isInputRange;
void method(R)(R range)
On Wed, Dec 03, 2014 at 01:20:59AM +0200, ketmar via Digitalmars-d wrote:
On Tue, 2 Dec 2014 14:00:09 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
// mymod.d
module mymod;
struct S {
// Now everyone is happy, right...?
On Tue, Dec 02, 2014 at 11:02:18PM +, Meta via Digitalmars-d wrote:
This whole thing is a huge hole in D that needs to be fixed (it may
even be necessary to consider it higher priority than the current C++
and GC).
Well, that's up to Walter Andrei to decide. :-P
As it works currently,
http://wiki.dlang.org/DIP22
On Tue, 2 Dec 2014 15:55:34 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
Hmm... actually, this gives me an idea. What if we implement a little
syntactic sugar for this in the compiler? Say:
scope import std.conv ... ;
scope import std.format ... ;
On 12/2/14 6:28 PM, H. S. Teoh via Digitalmars-d wrote:
Technically, you *can* do that, but it's a lot more verbose (plus, ddoc
doesn't know how to generate docs for eponymous templates properly and
it looks ugly):
template method(R)
{
import std.range :
On Tue, Dec 02, 2014 at 08:11:52PM -0500, Steven Schveighoffer via
Digitalmars-d wrote:
On 12/2/14 6:28 PM, H. S. Teoh via Digitalmars-d wrote:
Technically, you *can* do that, but it's a lot more verbose (plus,
ddoc doesn't know how to generate docs for eponymous templates
properly and it
On Tue, 2 Dec 2014 17:33:09 -0800
H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Tue, Dec 02, 2014 at 08:11:52PM -0500, Steven Schveighoffer via
Digitalmars-d wrote:
On 12/2/14 6:28 PM, H. S. Teoh via Digitalmars-d wrote:
Technically, you *can* do that, but it's a
32 matches
Mail list logo