April 20, 2009
bearophile wrote:
> Assertion failure: '0' on line 935 in file 'glue.c'

All assertion failures are compiler bugs and belong in bugzilla:

http://d.puremagic.com/issues/show_bug.cgi?id=2863
April 20, 2009
tama wrote:
> I tested following code.
> 
> writefln(3 * 4);
> 
> This code doesn't work in the first place:-<

Yes, that's one of the breaking changes in the new phobos2. writefln expects its first argument to be a format string.

If it isn't, use writeln instead.
April 20, 2009
Andrei Alexandrescu wrote:
> Ok, I've undeprecated rand_seed, sigh. I was hoping I'd eliminate rand() entirely from this release, but Walter pointed out it would break too much code. So I left rand() and rand_seed() as deprecated. Now I only left rand() deprecated so at least the static constructor works.

I think the right fix for that is for the compiler to not complain about deprecated symbol usage if the usage is in the same module the deprecated symbol is defined in.
April 20, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2864
April 20, 2009
Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> Ok, I've undeprecated rand_seed, sigh. I was hoping I'd eliminate rand() entirely from this release, but Walter pointed out it would break too much code. So I left rand() and rand_seed() as deprecated. Now I only left rand() deprecated so at least the static constructor works.
> 
> I think the right fix for that is for the compiler to not complain about deprecated symbol usage if the usage is in the same module the deprecated symbol is defined in.

Reading this, I thought "No chance Walter will ever do this" until I saw the poster's name :o).

Andrei
April 20, 2009
superdan wrote:
> Craig Black Wrote:
> 
>> I like very much the direction D2 is going now.  Language refactoring and enhancements driven by the goal of more elegant implementation of standard libraries.  This approach seems very practical and promising.  Thank you very much and keep it up!
>>
>> -Craig 
> 
> holy guacashit this works.
> 
> import std.algorithm;
> import std.range;
> import std.stdio;
> 
> void main()
> {
>     string[] a = [ "shit", "poop" ];
>     string[] b = [ "dump", "shite" ];
>     sort!((a, b) { return a > b; })(chain(a, b));
>     writeln(a, " ", b);
> }
> 
> i'll be shat on. couple shitty problems tho. auto don't work shit for a and b. complains about fixed size strings'n'shit. then writeln(chain(a, b)) shites ChainImpl!(immutable(char)[][],immutable(char)[][]) to stdout. tat's liable to scare da shit outta a beginner.
> 

Thanks... I guess :o). Any chance you could submit the issues to bugzilla? I think the problem with string arrays is already known, but I need a memento to make writeln work with ranges.

Andrei
April 20, 2009
Andrei Alexandrescu wrote:
> Walter Bright wrote:
>> I think the right fix for that is for the compiler to not complain about deprecated symbol usage if the usage is in the same module the deprecated symbol is defined in.
> 
> Reading this, I thought "No chance Walter will ever do this" until I saw the poster's name :o).

It is consistent with the ideas behind private access. Presumably the person working on the module knows what they're doing, no need to hide it from himself.
April 20, 2009
Craig Black wrote:
> I like very much the direction D2 is going now.  Language refactoring and enhancements driven by the goal of more elegant implementation of standard libraries.  This approach seems very practical and promising.  Thank you very much and keep it up!
> 
> -Craig

Thanks. Walter pointed out to me something interesting - STL is non-intuitive. That doesn't make it any less true (as a pursuit of the most generic incarnation of fundamental structs and algos). It's non-intuitive the same way complex numbers and relativity theory are non-intuitive.

No language has ever managed to comprehend STL by sheer chance. (This in spite of e.g. C# adding a boatload of new features with each release.) There are two that can express it at all: C++ and D. Both C++ and D had to be changed to allow STL to exist, and became better languages as a result. The range shtick and D's support for lambdas is taking STL support to a whole new level.

The downside is, it's rather difficult to explain the STL to anyone using other languages and wanting to just figure what the STL buzz is all about.


Andrei
April 20, 2009
Walter Bright wrote:
> tama wrote:
>> I tested following code.
>>
>> writefln(3 * 4);
>>
>> This code doesn't work in the first place:-<
> 
> Yes, that's one of the breaking changes in the new phobos2. writefln
> expects its first argument to be a format string.
> 
> If it isn't, use writeln instead.

I just hit the same breakage. :(

Since the compiler can detect this situation statically, shouldn't Phobos just statically redirect the call to writeln() ?
April 20, 2009
Walter Bright wrote:
> 
> This is a major revision to Phobos, including Andrei's revolutionary new range support.
> 
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.029.zip

Was fwritefln() removed intentionally?  Or should I write up a Bugzilla?  I didn't noteice a mention in changelog.