Re: Identifier resolution, the great implementation defined mess.

On 9/21/2014 2:17 PM, ketmar via Digitalmars-d wrote:
> On Sun, 21 Sep 2014 13:04:49 -0700
> Walter Bright via Digitalmars-d <digitalmars-d <at> puremagic.com> wrote:
>
>> I don't know what mental model people have for how lookups work, but
>> the above algorithm is how it actually works.
> i believe that people expect this:
>
>    void foo (int a) {
>      import a;
>      a.bar(); // here we use 'a' module
>      xyzzy(); // it's actually 'a.xyzzy', and 'a as module' is implicit
>      writeln(a); // here we use 'int a' argument

Context dependent lookups? That's an awful lot more complex than the existing rules.

>    }
>
> i.e. symbol resolver will try argument/local name first, and only if it
> failed tries to search in module.

That's how it does work. It's just that parameters are in an enclosing scope.

> or, more complicated sample:
>
>    struct A { int bar; int baz; }
>    void foo (in A a) {
>      import a;
>      a.bar(); // KABOOM, conflicting names
>      xyzzy(); // it's actually 'a.xyzzy', and 'a as module' is implicit
(Continue reading)

Re: RFC: scope and borrowing

On 9/21/2014 4:27 AM, Manu via Digitalmars-d wrote:
> It's also extremely hard to unittest; explodes the number of static if paths
> exponentially. I'm constantly finding bugs appear a year after writing some code
> because I missed some static branch paths when originally authoring.

If you throw -cov while running unittests, it'll give you a report on which code 
was executed and which wasn't. Very simple and useful.

Re: What are the worst parts of D?

On Sunday, 21 September 2014 at 23:04:22 UTC, H. S. Teoh via 
Digitalmars-d wrote:
> Eventually the real solution is automatic inference, with the 
> user
> using explicit attributes at the top-level where they are 
> desired, and
> the compiler will take care of the rest.

Yes, but you need a model of the semantics you are looking for.

Re: Library Typedefs are fundamentally broken

On Sunday, 21 September 2014 at 23:00:09 UTC, ketmar via 
Digitalmars-d wrote:
> i believe that we should revive 'typedef' keyword, but i'm not 
> fully
> convinced yet. so i'll wait a little more. but you guessed it 
> right,
> i'm thinking about another patch. ;-)

It's a nice small project, if I didn't have backlog I'd give it a 
go. Sounds fun.

Re: What are the worst parts of D?

On Sunday, 21 September 2014 at 22:41:04 UTC, H. S. Teoh via 
Digitalmars-d wrote:
> with, and you'd have to explicitly ask for impure / mutable

"Impure" should be on parameters so you can do dataflow in the 
presence of FFI.

So you basically need better mechanisms.

But then you have to analyze the needs first (e.g. the desirable 
semantics that currently are avoided) All of then.

Adding one hack after the other is not the best approach.

Re: Library Typedefs are fundamentally broken

On 9/21/14, 2:32 PM, ketmar via Digitalmars-d wrote:
> On Sun, 21 Sep 2014 20:48:34 +0000
> Tourist via Digitalmars-d <digitalmars-d <at> puremagic.com> wrote:
>
>> Why don't you capitalize?
> it's my "one man's crusade" against the thing i see as completely
> useless.
>
>> Looks like you're a reasonable person, and this makes an outsider
>> think that your IQ is lower than the average. IMO.
> and my English is bad too (mea culpa; i have to fix it by taking some
> courses). but i believe that arguments aren't depend of the speaker.
> and i don't care what people think about my personality. if they choose
> to ignore everything i'm writing just 'cause they think that i'm dumb...
> ah, so be it. it's arguments that counts, not their source.

I don't mind the capitalization, ad hominem, etc. The arguments against 
Typedef are honestly terrible (by all participants), and the attempts at 
enhancing them through hyperbole are embarrassing. -- Andrei

Re: Library Typedefs are fundamentally broken

On 9/21/14, 1:41 PM, ketmar via Digitalmars-d wrote:
> On Sun, 21 Sep 2014 11:09:28 -0700
> Andrei Alexandrescu via Digitalmars-d <digitalmars-d <at> puremagic.com>
> wrote:
>
>>>> alias Int1 = Typedef!(int, "a.Int1");
>>>> alias Int2 = Typedef!(int, "b.Int2");
>>> ah, now that's cool. module system? wut? screw it, we have
>>> time-proven manual prefixing!
>> Use __MODULE__. -- Andrei
> you still can't grok concept of "ugly == unusable".

Also I must be missing the distinction between "workable solution" and 
"usable solution". Such semantic subtleties seem to be lost on me in 
this context.

> thank you, i'd
> better fsck this miserably attempt on type security, and many other
> practical programmers too. we trying to explain you this and each time
> you answers "so what? no, it's not." even to people who tried to use
> this disgusting "solution" and found it unacceptable and broken.

The problem here is inept argumentation. I'm all for a well argued 
debate. This argument seems to have trouble getting legs, and foaming at 
the mouth is unlikely to add value to it.

> alias Int1 = Typedef!(int, __MODULE__~".Int1");
>
> don't make me laugh. this is not just ugly, this is MEGAUGLY.

(Continue reading)

Re: Library Typedefs are fundamentally broken

On Sunday, 21 September 2014 at 20:49:02 UTC, ketmar via 
Digitalmars-d wrote:
> On Sun, 21 Sep 2014 19:56:48 +0200
> Marco Leise via Digitalmars-d <digitalmars-d <at> puremagic.com> 
> wrote:
>
>> It is after all a convenience feature
> easy type safety is just "a convient feature"? O_O
>
> i'm wordless.

I am waiting for a patch...

Tourist via Digitalmars-d | 21 Sep 22:48 2014

Re: Library Typedefs are fundamentally broken

On Sunday, 21 September 2014 at 20:41:22 UTC, ketmar via
Digitalmars-d wrote:
> On Sun, 21 Sep 2014 11:09:28 -0700
> Andrei Alexandrescu via Digitalmars-d 
> <digitalmars-d <at> puremagic.com>
> wrote:
>
>> >> alias Int1 = Typedef!(int, "a.Int1");
>> >> alias Int2 = Typedef!(int, "b.Int2");
>> > ah, now that's cool. module system? wut? screw it, we have
>> > time-proven manual prefixing!
>> Use __MODULE__. -- Andrei
> you still can't grok concept of "ugly == unusable". thank you, 
> i'd
> better fsck this miserably attempt on type security, and many 
> other
> practical programmers too. we trying to explain you this and 
> each time
> you answers "so what? no, it's not." even to people who tried 
> to use
> this disgusting "solution" and found it unacceptable and broken.
>
> alias Int1 = Typedef!(int, __MODULE__~".Int1");
>
> don't make me laugh. this is not just ugly, this is MEGAUGLY. 
> then we
> can make some kind of magic template to hide this uglyness, 
> yes. the
> uglyness which shouldn't be there in the first place. each time 
> when
(Continue reading)

Re: RFC: reference counted Throwable

On 9/21/14, 9:42 AM, Andrej Mitrovic via Digitalmars-d wrote:
> On 9/21/14, Andrei Alexandrescu via Digitalmars-d
> <digitalmars-d <at> puremagic.com> wrote:
>> (For practical reasons, RCObject will implement IUnknown.
>
> IUnknown has this issue btw:
> https://issues.dlang.org/show_bug.cgi?id=12607

Thanks, good to know. IMHO having RCObject inherit IUnknown is more of a 
distraction than a benefit, but I'll let Walter be the judge of that. -- 
Andrei

Re: Library Typedefs are fundamentally broken

On 9/21/14, 8:29 AM, ketmar via Digitalmars-d wrote:
> On Sun, 21 Sep 2014 08:15:29 -0700
> Andrei Alexandrescu via Digitalmars-d <digitalmars-d <at> puremagic.com>
> wrote:
>
>> alias Int1 = Typedef!(int, "a.Int1");
>> alias Int2 = Typedef!(int, "b.Int2");
> ah, now that's cool. module system? wut? screw it, we have time-proven
> manual prefixing!

Use __MODULE__. -- Andrei


Gmane