Tango for D2: All user modules ported

Timon Gehr timon.gehr at gmx.ch
Thu Feb 9 09:39:38 PST 2012


On 02/09/2012 06:05 PM, HeiHon wrote:
> On Saturday, 4 February 2012 at 10:56:14 UTC, bobef wrote:
>> Great news. ...
> Same here!
>
> This is the number one thing I waited for to be ported to D2. I never
> considered moving to D2 without Tango. Big thanks to SiegeLord and all
> the other contributors.
>

For me it is the other way round: I never considered trying Tango until 
it was ported to D2. =)

> Just one example why I like Tango:
>
> hello_tango.d:
> module hello_tango;
> // dmd 2.057 + SiegeLord-Tango-D2-4c9566e 2012-01-24
> import tango.io.Stdout;
>
> int main(string[] args)
> {
> foreach(i, arg; args)
> {
> Stdout.formatln(" arg {,3}: '{}'", i, arg);
> }
> return 0;
> }
>
> rdmd --build-only -release -O hello_tango.d
>
> hello_tango a b ä ö
> arg 0: 'hello_tango'
> arg 1: 'a'
> arg 2: 'b'
> arg 3: 'ä'
> arg 4: 'ö'
>
>
> hello_phobos.d:
> module hello_phobos;
>
> // dmd 2.057
> import std.stdio;
>
> int main(string[] args)
> {
> foreach(i, arg; args)
> {
> stdout.writefln(" arg %3d: '%s'", i, arg);
> }
> return 0;
> }
>

fixed:

import std.stdio;

void main(string[] args){
    foreach(i, arg; args){
        writefln("  arg %3d: '%s'", i, arg);
    }
}

> rdmd --build-only -release -O hello_phobos.d
>
> hello_phobos a b ä ö
> arg 0: 'hello_phobos'
> arg 1: 'a'
> arg 2: 'b'
> arg 3: '+ñ'
> arg 4: '+Â'
>
>
> E:\source\D\d2>dir he*
> 09.02.2012 15:18 204 hello_phobos.d
> 09.02.2012 15:18 992.284 hello_phobos.exe
> 09.02.2012 15:18 250 hello_tango.d
> 09.02.2012 15:18 180.764 hello_tango.exe
>
> The hello_tango.exe is much smaller and it even works with strange
> german umlauts :-)
>

Works for me with Phobos perfectly fine. What platform are you on? 
(probably Windows?)

> BTW:
> Tango doesn't build (bob) with dmd 2.058 beta because of:
> ...
> dmd -c -I. -release -oftango-net-device-Berkeley-release.obj
> ./tango/net/device/Berkeley.d
> object.Exception at build\src\bob.d(632): Process exited normally with
> return code 1
> .\tango\net\device\Berkeley.d(1921): Error: cannot implicitly convert
> expression (new char[][](cast(uint)i)) of type char[][] to const(char)[][]
>

Harmless 'bug' exposed by bugfix in compiler. Should be a trivial. It 
would cease to be an issue if this enhancement was implemented in the 
compiler:

http://d.puremagic.com/issues/show_bug.cgi?id=7208



More information about the Digitalmars-d-announce mailing list