[Issue 15065] New: associative array has no keys property

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15065

  Issue ID: 15065
   Summary: associative array has no keys property
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: vlevenf...@gmail.com

struct X (int[int] x)
{
enum y = x.keys; // OK
alias z = partial!(canFind, y); // OK
alias w = partial!(canFind, x.keys); // Error: no property 'keys' for type
'int[int]'
}

X!([1:2]) zzz;

--


[Issue 15066] std.net.curl.get should support IPv6 addresses on Windows

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15066

Luís Marques  changed:

   What|Removed |Added

Summary|std.net.curl.get should |std.net.curl.get should
   |support IPv6 addresses  |support IPv6 addresses on
   ||Windows

--


[Issue 15066] New: std.net.curl.get should support IPv6 addresses

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15066

  Issue ID: 15066
   Summary: std.net.curl.get should support IPv6 addresses
   Product: D
   Version: D2
  Hardware: x86
OS: Windows
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: l...@luismarques.eu

This works on OS X but not on Windows:

void main()
{
import std.net.curl;

// neither work (IPv6 addresses, no DNS needed):
get("http://[::1]:8080/;);
get("http://[2a00:1450:4004:801::200e]/;);
}

Error: "std.net.curl.CurlException@std\net\curl.d(3705): Couldn't resolve host
name on handle 1D80048"

--


Re: Initalizing complex array types or some other problem ;/

2015-09-15 Thread Prudence via Digitalmars-d-learn

On Tuesday, 15 September 2015 at 20:54:49 UTC, anonymous wrote:

On Tuesday 15 September 2015 22:09, Prudence wrote:


The code below doesn't work.


Please be more specific in how it doesn't work. Mention the 
error message if there is one, or say how the code behaves 
differently from what you'd expect.


Trying to compile the code (after kicking getch out), I get 
this error:

core.exception.RangeError@test.d(103): Range violation

Line 103 is: writeln(MyStore.Store[k].length);

I can't find where you set Store[k]. Maybe you forgot that or 
deleted it accidentally?


I made a guess and added this line in SingleStore.New:
o.Store[k] ~= tuple(v, o);

It still throws a range error with this. That's because 
associative arrays are a little weird, unfortunately.


An AA is effectively initialized on the first assignment. So 
(with my addition) the first SingleStore.New call initializes 
the AA. But it only initializes o.Store, not the original 
variable s (i.e. ObjectStore.Store). s is left empty.


Possible solutions/workarounds:
* Append to s[k], then assign s to o.Store.
* Initialize ObjectStore.Store in a static constructor:

static this()
{
Store[TKey.init] = [];
Store.remove(TKey.init);
}


Maybe. Seems to work without it. The code below should compile on 
your system and work(and prints 1 2 3 4, 4 3 2 1). The getch is 
required on windows if I want to see the output, so I don't know 
why you even bothered mention replacing it.






import std.stdio;
import std.concurrency;



extern (C) int getch();
import std.string;
import std.concurrency;
import core.time;
import core.thread;
import std.container.array;
import std.typecons;







public class SingleStore(TKey, TValue)
{
public TValue Value;
public TKey Key;
public Tuple!(TValue, SingleStore!(TKey, TValue))[][TKey] Store;


	// Duplicate entries will be removed together as there is no way 
to distinguish them

public auto Remove()
{
import std.algorithm;
if (Value == null || Key == null) return;
int count = 0;
for(int i = 0; i < Store[Key].length; i++)
{
if (Store[Key][i][0] == Value && Store[Key][i][1] == 
this)
{
count++;
	Store[Key][i] = tuple(null, null); // Set to null to release 
any references if necessary
	swap(Store[Key][i], Store[Key][max(0, Store[Key].length - 
count)]);

i = i - 1;
}

}
if (count == 1 && Store[Key].length == 1)
{
Store[Key] = null;
Store.remove(Key);
} else
//Store[Key] = 
Store[Key][0..max(0,Store[Key].length-count)];
Store[Key].length = Store[Key].length - count;

Value = null;
Key = null;

}

	public static auto New(TKey k, TValue v, ref Tuple!(TValue, 
SingleStore!(TKey, TValue))[][TKey] s)

{
auto o = new SingleStore!(TKey, TValue)();  // GC
o.Key = k;
o.Value = v;
s[k] ~= tuple(v, o);
o.Store = s;

return o;
}

}


// Creates a static Associative Array that stores multiple values 
per key. The object returned by New can then be used to remove 
the key/value without having to remember specifically them.

public mixin template ObjectStore(TKey, TValue)
{
	// The object store. It is static. Mixin the template into it's 
different types to create different types of stores. All objects 
of that type are then in the same store.
	public static Tuple!(TValue, SingleStore!(TKey, TValue))[][TKey] 
Store;


public static auto New(TKey k, TValue v)
{
auto r =  SingleStore!(TKey, TValue).New(k, v, Store);
return r;
}

}

//alias dg = int delegate(int);
alias dg = string;

public class cMyStore(TKey, TValue)
{
//mixin ObjectStore!(string, dg);
mixin ObjectStore!(string, string); 
}



void main()
{
alias MyStore = cMyStore!(string, string);
auto k = "x";

auto r = 

/*
dg d1 = (int x) { return x; };
dg d2 = (int x) { return x; };
dg d3 = d1;
dg d4 = (int x) { return 3*x; };
*/

dg d1 = "a1";
dg d2 = "a2";
dg d3 = "a3";
dg d4 = "a4";



auto s = MyStore.New(k, d1);
writeln(MyStore.Store[k].length);
auto s1 = MyStore.New(k, d2);
writeln(MyStore.Store[k].length);
auto s2 = MyStore.New(k, d3);
writeln(MyStore.Store[k].length);
auto s3 = MyStore.New(k, d4);
writeln(MyStore.Store[k].length);   


//auto x = MyStore.Store[k][0](3);
  

[Issue 15065] associative array has no keys property

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15065

--- Comment #1 from Kenji Hara  ---
Reduced test case:

template partial(alias arg) {}

struct X(int[int] x)
{
alias w = partial!(x.keys);
}

X!([1:2]) zzz;

--


Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
I'm trying to make a base class with get property and a sub class 
with corresponding set property. The value for the base class is 
set via constructor.
The intuitive way doesn't seem to work and workarounds are 
unnecessarily ugly (considering you'll sprinkle them all over the 
codebase).


class Father
{
int eat()
{
return 1;
}
}

class Daughter : Father
{

void eat( int apples ) {}

// int eat() { return super.eat(); }// Workaround A, 
works as expected
//override int eat( int apples ) {} // Workaround D, 
fails -> Error: function main.Daughter.eat does not override any 
function, did you mean to override 'main.Father.eat'?

}

Daughter d = new Daughter();

// BUG? I expected this to work. It seems that compiler doesn't 
even look into parent class to see if there's a matching function.
//int num = d.eat();// Error: function 
main.Daughter.eat (int apples) is not callable using argument 
types ()


int num2 = (cast(Father)d).eat();   // Workaround B, works as 
expected

int num3 = d.Father.eat();  // Workaround C, works as well


Re: Another, is it a bug?

2015-09-15 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 02:59:06 UTC, Random D user 
wrote:
I'm trying to make a base class with get property and a sub 
class with corresponding set property. The value for the base 
class is set via constructor.
The intuitive way doesn't seem to work and workarounds are 
unnecessarily ugly (considering you'll sprinkle them all over 
the codebase).


class Father
{
int eat()
{
return 1;
}
}

class Daughter : Father
{

void eat( int apples ) {}

// int eat() { return super.eat(); }// Workaround A, 
works as expected
//override int eat( int apples ) {} // Workaround D, 
fails -> Error: function main.Daughter.eat does not override 
any function, did you mean to override 'main.Father.eat'?

}

Daughter d = new Daughter();

// BUG? I expected this to work. It seems that compiler doesn't 
even look into parent class to see if there's a matching 
function.
//int num = d.eat();// Error: function 
main.Daughter.eat (int apples) is not callable using argument 
types ()


int num2 = (cast(Father)d).eat();   // Workaround B, works as 
expected
int num3 = d.Father.eat();  // Workaround C, works as 
well


Considering Father defines the function `int eat()` and Daughter 
defines the completely different function `int eat(int)`, it 
doesn't surprise me. You're not using virtual dispatch when you 
do `return super.eat` or `d.Father.eat()`, you're delegating the 
method call to the base class.


Re: Another, is it a bug?

2015-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user
Given that, normally properties are just overloaded methods in 
D, it's pretty sad classes break this behavior/convention.


The D behavior for overloading is different in general:

http://dlang.org/hijack.html

It basically never overloads across scopes. You need to alias the 
name into the scope too explicitly


Best Direction on Spawning Process Async

2015-09-15 Thread Mike McKee via Digitalmars-d-learn

What's the best direction from...

http://dlang.org/phobos/std_process.html

...on spawning an async process and then peeking at it 
occasionally as it runs, and then get notified when it finishes? 
In other words, what std.process functions would you recommend I 
use? What I want to avoid is a blocking state where the GUI 
freezes because it's waiting for the process to complete.


For instance, imagine you are building a front end GUI (like 
GtkD) to a command-line based antivirus scanner. You'll want to 
spawn the process, show a progress bar, and as the command line 
returns status information, you peek at it asynchronously and 
then update the progress bar (or perhaps store virus detected 
info in a table), and then stop the progress bar at 100% when the 
command process has finished.




Re: Final templated interface method not found

2015-09-15 Thread anonymous via Digitalmars-d-learn
On Wednesday 16 September 2015 06:14, Andre wrote:

> Hi,
> 
> following coding shoud work, or?
> It doesn't compile with v2.068.0.
> 
> Kind regards
> André
> 
> interface IfStatement
> {
>   void execute();
>   
>   final void execute(T...)(T t)
>   {
>   execute();
>   }
> }
> 
> class Statement: IfStatement
> {
>   void execute(){}
> }
> 
> void main()
> {
>   new Statement().execute(1,"Hello World");
> }

You need to add IfStatement.execute to the overload set like so:

class Statement: IfStatement
{
alias execute = IfStatement.execute;
void execute(){}
}



Re: Implementing typestate

2015-09-15 Thread Freddy via Digitalmars-d

On Tuesday, 15 September 2015 at 21:44:25 UTC, Freddy wrote:

On Tuesday, 15 September 2015 at 17:45:45 UTC, Freddy wrote:

 Rust style memory management in a library


Wait nevermind about that part, it's harder than I thought.


All hope might not be lost, something like this MIGHT work,but 
i'm am sure I am missing some kind of detail.

---
//doesn't actually compile
struct MutBorrow(T, bool usable_ = true)
{
private T** ptr;
enum usable = usable_;
static if (usable)
{
@disable this();
ref T use()
{
return **ptr;
}
}
//...
}

struct Unique(T)
{
private T* ptr;

alias user = null;

~this()
{
static assert(user is null);
free(ptr);
}

auto giveMut(alias local)()
{
static assert(is(user : null)));
user = local;
local.usable = true;
local.ptr = 
}

auto takeMut(alias local)()
{
static assert(local == user); //is there a proper way to 
compare alias?

user = null;
local.usable = false;
}

static if ( /+user not null+/ )
{
ref T use()
{
return *ptr;
}
}
}
---


Runtime error when calling a callback in a parallel Task

2015-09-15 Thread BBasile via Digitalmars-d-learn
Under Windows this works fine but under Linux I got a runtime 
error.


this could be reduced to :

---
import std.parallelism;

alias CallBack = void function(void*);

class Foo
{
CallBack clbck;
void* param;
void dotask()
{
// some heavy processing
// tells the caller that some fresh data are available
if(clbck) clbck(param);  // debugger breaks HERE
}

void call()
{
task().executeInNewThread;
// returns directly but the caller will get a notif when 
finished

}
}
---

more info about the environment:
- linux i386
- the D program is actually a .so and the main thread is the exe 
that loads this .so.

- If i don't use a Task then the program works **fine**.

Is it possible to achieve this in a cross platform-way ?
How can i get in phase with the main big thread at the end of my 
task ?


[Issue 15064] [CTFE] std.range.enumerate is not CTFE-able

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15064

--- Comment #1 from Kenji Hara  ---
Please add a test case, at least.

--


Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn

On Wednesday, 16 September 2015 at 03:17:05 UTC, Meta wrote:
Considering Father defines the function `int eat()` and 
Daughter defines the completely different function `int 
eat(int)`, it doesn't surprise me. You're not using virtual 
dispatch when you do `return super.eat` or `d.Father.eat()`, 
you're delegating the method call to the base class.


Yeah... I guess I was expecting it to overload across class 
boundaries. I mean there's already a member eat in base class and 
sub class can't override that since it's got different 
parameters, and it's a function (can't be variable), so the 
reasonable thing would be to overload it (which is why I tried 
override to see if it forces/hints overriding/overloading).
Instead it creates two ambiguous names of which only one has to 
be disambiguated to use which seems super error prone. IMO it 
should just be error/warning.


Given that, normally properties are just overloaded methods in D, 
it's pretty sad classes break this behavior/convention.


Re: chaining chain Result and underlying object of chain

2015-09-15 Thread Steven Schveighoffer via Digitalmars-d-learn

On 9/14/15 11:30 AM, Ali Çehreli wrote:

On 09/14/2015 08:01 AM, Laeeth Isharc wrote:
 > I was trying to use the same variable eg
 >
 >auto chain1 = chain("foo", "bar");
 >chain1 = chain(chain1, "baz");
[...]
 > It may be that the type of chain1
 > and chain2 don't mix.

Exactly.

I was going to recommend using pragma(msg, typeof(chain1)) to see what
they are but it looks like chain()'s return type is not templatized. (?)

 pragma(msg, typeof(chain1));
 pragma(msg, typeof(chain2));

Prints

Result
Result

instead of something like (hypothetical)

ChainResult!(string, string)
ChainResult!(ChainResult!(string, string), string)

Ali


typeid is a bit better:

import std.range;

void main()
{
import std.stdio;
auto chain1 = chain("hi", "there");
auto chain2 = chain(chain1, "friend");
writeln(typeid(chain1));
writeln(typeid(chain2));
}

output:

std.range.chain!(string, string).chain.Result
std.range.chain!(Result, string).chain.Result

I still see that "Result" as a parameter for chain2.

I think the compiler should be better at printing these types at compile 
time.


-Steve


Re: Implementing typestate

2015-09-15 Thread Tobias Müller via Digitalmars-d
Ola Fosheim Grøstad  wrote:
> On Tuesday, 15 September 2015 at 20:34:43 UTC, Tobias Müller wrote:
>>> There's a Blog post somewhere but I can't find it atm.
>> 
>> Ok found it: > http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/
> 
> But that is for runtime detection, not compile time?

Not as far as I understand it.
The marker is a type, not a value. And it's used as template param.
But you need non-copyable move-only types for it to work.

In D it would probably look like:

File!Open file = open(...);
File!Closed file = close(file);

Tobi


running code on the homepage

2015-09-15 Thread Andrei Amatuni via Digitalmars-d
maybe I'm doing something wrong...but the output of running the 
default code snippet on the dlang.org homepage is:


"unable to fork: Cannot allocate memory"

not a good look


Re: Load Qt UI XML File as GUI

2015-09-15 Thread Steven Schveighoffer via Digitalmars-d-learn

On 9/16/15 12:03 AM, Mike McKee wrote:

Unfortunately, the http://dsource.org/forums/ doesn't appear to be
active -- I can't login after I registered. This is where the QtD
project has their forum. So, I'm asking this here.


Seems to have moved here, but it doesn't look fresh:

https://bitbucket.org/qtd/

dsource is dead (only there for archive reasons), don't use it.

-Steve


Load Qt UI XML File as GUI

2015-09-15 Thread Mike McKee via Digitalmars-d-learn
Unfortunately, the http://dsource.org/forums/ doesn't appear to 
be active -- I can't login after I registered. This is where the 
QtD project has their forum. So, I'm asking this here.


Is it possible with D and QtD to draw my GUI using QtCreator, and 
then take its UI XML file and load it somehow via QtD and D? That 
way, I don't need to do everything by hand and can utilize the 
power of a WYSIWYG form tool (like Glade), and then just 
manipulate the rest by code after that?





Final templated interface method not found

2015-09-15 Thread Andre via Digitalmars-d-learn

Hi,

following coding shoud work, or?
It doesn't compile with v2.068.0.

Kind regards
André

interface IfStatement
{
void execute();

final void execute(T...)(T t)
{
execute();
}
}

class Statement: IfStatement
{
void execute(){}
}

void main()
{
new Statement().execute(1,"Hello World");
}


Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:54:34 UTC, Adam D. Ruppe 
wrote:

On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user
Given that, normally properties are just overloaded methods in 
D, it's pretty sad classes break this behavior/convention.


The D behavior for overloading is different in general:

http://dlang.org/hijack.html

It basically never overloads across scopes. You need to alias 
the name into the scope too explicitly


Thanks. That pretty much answers directly to all my questions. I 
tried to look for this info in class docs/reference, but couldn't 
find it (obviously). I never thought that this would be in 
"articles".


Re: Load Qt UI XML File as GUI

2015-09-15 Thread Mike McKee via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 04:36:15 UTC, Steven 
Schveighoffer wrote:

Seems to have moved here, but it doesn't look fresh:

https://bitbucket.org/qtd/


Yep, but when I poke around in the source, I can't see anywhere 
that the QtD can read the .ui files that QtCreator creates.





Re: Initalizing complex array types or some other problem ;/

2015-09-15 Thread anonymous via Digitalmars-d-learn
On Wednesday 16 September 2015 03:46, Prudence wrote:

> In any case, Maybe you are not as smart as you think you are if 
> you can't understand it?

kthxbye


[Issue 15045] [Reg 2.069-devel] hasElaborateCopyConstructor is true for struct with opDispatch

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15045

Kenji Hara  changed:

   What|Removed |Added

 CC||schue...@gmx.net

--- Comment #7 from Kenji Hara  ---
*** Issue 15016 has been marked as a duplicate of this issue. ***

--


[Issue 15016] Structs with opDispatch cannot be emplaced

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15016

Kenji Hara  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #5 from Kenji Hara  ---
The root problem is same with 15045, and it's fixed by the adjustment of
forwarding member access behavior.

*** This issue has been marked as a duplicate of issue 15045 ***

--


[Issue 15063] Template Instantiation Accepts Invalid Code

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15063

--- Comment #1 from Kenji Hara  ---
Reduced test case:

void test1(alias pred = "a == b", T)(T a)
{
pragma(msg, 1);
}

void test1(int flag = 0, T)(T a)
{
pragma(msg, 2);
}

void main()
{
test1(1);
}

--


Re: dpaste web site

2015-09-15 Thread nazriel via Digitalmars-d
On Wednesday, 9 September 2015 at 23:55:27 UTC, Vladimir 
Panteleev wrote:

On Wednesday, 9 September 2015 at 22:59:42 UTC, nazriel wrote:

I really have no idea,
I tried to copy and paste those links and indeed they trigger 
recaptcha...
Not sure if recaptcha is so weak or indeed it is a human 
posting those links %)


It costs 0.1 cent ($0.001) to have a human solve a reCAPTCHA.


I will look into methods used in this forum and vibe.d forum.


For forum.dlang.org and wiki.dlang.org I created DCaptcha, 
which asks a D programming question: 
https://github.com/CyberShadow/dcaptcha


It is only activated if Akismet or other spam detectors report 
"spam". It used to have many questions of various difficulty, 
but currently it only asks 1 type of question. So far this 
blocked 100% of spam.


AFAIK vibe.d forum uses a Bayesian filter which IIRC generally 
works well but had to be tweaked once or twice. This could work 
well for DPaste if it's trained to distinguish D code from 
not-code.


Nice,

I've tried your idea (somehow). Lets see if it helps.

Anyways:
* I've implemented better captcha mechanism + blocking system.
If you fail captcha for 3 times in a row - pasting will be 
disabled for 15 minutes.
* I've fixed registration with GitHub, Facebook and internal 
database (captcha wasn't working there and api keys expired for 
those services)



The next step will be improving Backend itself so I will get rid 
of errors when running examples on main dlang page.


Also @Vladimir, thanks for the pull request regarding examples 
and for making me a "watcher" in dpaste related issues on 
bugzilla.



Best regards,
Damian Ziemba



[Issue 15045] [Reg 2.069-devel] hasElaborateCopyConstructor is true for struct with opDispatch

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15045

Kenji Hara  changed:

   What|Removed |Added

  Component|phobos  |dmd

--- Comment #6 from Kenji Hara  ---
Change to dmd issue.

--


Nested classes question?

2015-09-15 Thread Dave Akers via Digitalmars-d-learn
When a program exits and D's memory management is cleaning up 
calling all of the ~this's is there a reason it calls the outer 
class's ~this before the inner class's ~this?


I was recently exploring the possibility of using 
https://github.com/bheads/d-leveldb and the example in the readme 
seg faulted, when digging into it i found out that the outer 
class was being destroyed before the inner causing the database 
to be closed before an iterator for the database was destroyed.


Re: Nested classes question?

2015-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 16 September 2015 at 01:12:58 UTC, Dave Akers wrote:
When a program exits and D's memory management is cleaning up 
calling all of the ~this's is there a reason it calls the outer 
class's ~this before the inner class's ~this?


All class destructors are called in an undefined order. The 
garbage collector considers the whole object tree to be dead at 
once and just cleans it up in the most convenient order for it.


This means you should not access any member pointers or 
references to things that are managed by the garbage collector in 
a destructor. Manage subobjects manually if you want to destroy 
them in ~this.


Re: dpaste web site

2015-09-15 Thread Steven Schveighoffer via Digitalmars-d

On 9/15/15 7:51 PM, nazriel wrote:


Also @Vladimir, thanks for the pull request regarding examples and for
making me a "watcher" in dpaste related issues on bugzilla.


Thank YOU Damian for continuing to work on this, it's very important to 
the D community!


-Steve


[Issue 15064] [CTFE] std.range.enumerate is not CTFE-able

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15064

--- Comment #3 from Kenji Hara  ---
Thanks.

--


[Issue 15056] [REG2.068.1] Unstored RAII struct return yields bogus error: "cannot mix core.std.stdlib.alloca() and exception handling"

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15056

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #6 from Walter Bright  ---
> Not exactly sure why alloca doesn't work with EH handling

Because alloca shifts things around on the stack when it adds space, and the
generated EH tables do not account for that.

The only real fix for this is to implement official Elf-style exception
handling, which we should do anyway at some point. The fact that this was
compiling on early compilers doesn't mean it was working.

--


[Issue 15067] New: Broken links on D1 web site

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15067

  Issue ID: 15067
   Summary: Broken links on D1 web site
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: dlang.org
  Assignee: nob...@puremagic.com
  Reporter: bugzi...@digitalmars.com

:
http://ftp.digitalmars.com/dmd.59.zip
:
http://ftp.digitalmars.com/dmd.63.zip
:
http://ftp.digitalmars.com/dmd.64.zip
:
http://ftp.digitalmars.com/dmd.1.044.zip

--


Re: Enumap -- a lightweight AA alternative when your keys are enums

2015-09-15 Thread SimonN via Digitalmars-d-announce

On Sunday, 13 September 2015 at 03:33:15 UTC, rcorre wrote:
I've released v0.4.0, which implements foreach with ref, and 
(hopefully) atones for my crimes against const-correctness. You 
should be able to modify values in a loop and work with 
const/immutable Enumaps.


Thanks for the feedback!


Yes, the 0.4.x version works with my examples perfectly. Thanks 
for adding const support!


(I haven't tested yet every combination of const/mutable Enumap, 
const/mutable foraech-value, and direct/ref foreach-value. My 
examples are exactly what I'd do in normal projects anyway, 
mapping enum-values to ints.)


-- Simon


[Issue 15064] [CTFE] std.range.enumerate is not CTFE-able

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15064

--- Comment #2 from Jack Stouffer  ---
Sorry

int test()
{
import std.range : enumerate;

int[] a = [1];

foreach (i, e; a.enumerate) {}

return 0;
}

void main()
{
enum res = test(); // fails
int res = test(); // works fine
}

--


[Issue 15062] ElementType Causes Abnormally Long Compile Time

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15062

Kenji Hara  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Kenji Hara  ---


*** This issue has been marked as a duplicate of issue 14886 ***

--


[Issue 14886] [REG2.066] std.parallelism.parallel with large static array seems to hang compile

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14886

Kenji Hara  changed:

   What|Removed |Added

 CC||monkeywork...@hotmail.com

--- Comment #5 from Kenji Hara  ---
*** Issue 15062 has been marked as a duplicate of this issue. ***

--


Re: Implementing typestate

2015-09-15 Thread Freddy via Digitalmars-d

On Tuesday, 15 September 2015 at 17:45:45 UTC, Freddy wrote:

 Rust style memory management in a library


Wait nevermind about that part, it's harder than I thought.


Re: Combining Unique type with concurrency module

2015-09-15 Thread Alex via Digitalmars-d-learn

On Monday, 14 September 2015 at 08:08:35 UTC, Ali Çehreli wrote:

void main()
{
MultiThreadedUnique!S u1 = produce();
auto childTid2 = spawn(, thisTid);

u1.giveTo(childTid2);
send(childTid2, cast(shared(MultiThreadedUnique!S*)));

import core.thread;
thread_joinAll();

writeln("Successfully printed number.");
auto u2 = ();
}

Ali


ok... I tried the code. It works well in the first approach... 
But I have to think about it some more time... Thanks again!


Re: Implement the "unum" representation in D ?

2015-09-15 Thread ponce via Digitalmars-d

On Tuesday, 15 September 2015 at 05:16:53 UTC, deadalnix wrote:


The guy seems to have good credential. Why should I read that 
book ?


The sample chapter dissipates a bit the marketing cloud.
One of the ideas is that the imprecise bit encode an interval 
between 2 values, hence automatically computing the "precision" 
of a computation without analysis.





Re: Release D 2.068.1

2015-09-15 Thread Jacob Carlborg via Digitalmars-d-announce

On 2015-09-10 19:46, Jack Stouffer wrote:


Well, it's a little too late, but the compiler outputs the wrong version:

$ dmd --version
DMD64 D Compiler v2.068
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright


Working fine here, installed using DVM.

--
/Jacob Carlborg


Re: Implement the "unum" representation in D ?

2015-09-15 Thread deadalnix via Digitalmars-d

On Tuesday, 15 September 2015 at 07:07:20 UTC, ponce wrote:

On Tuesday, 15 September 2015 at 05:16:53 UTC, deadalnix wrote:


The guy seems to have good credential. Why should I read that 
book ?


The sample chapter dissipates a bit the marketing cloud.
One of the ideas is that the imprecise bit encode an interval 
between 2 values, hence automatically computing the "precision" 
of a computation without analysis.


Read it. That is suddenly much less impressive, but much more 
sensible.


Re: std.experimental.testing formal review

2015-09-15 Thread Atila Neves via Digitalmars-d
On Wednesday, 9 September 2015 at 15:20:41 UTC, Robert burner 
Schadek wrote:
This post marks the start of the two week review process of 
std.experimental.testing.


PR: https://github.com/D-Programming-Language/phobos/pull/3207
Dub: http://code.dlang.org/packages/unit-threaded
Doc: See CyberShadow/DAutoTest for up-to-date documentation 
build


Previous Thread: 
http://forum.dlang.org/post/uzocokshugchescba...@forum.dlang.org


I've updated the PR with a proposal on the functionality to 
auto-generate the file containing the main function to run the 
unit tests.


Atila


Berlin D Meetup September 2015

2015-09-15 Thread Ben Palmer via Digitalmars-d-announce

Hi All,

The next Berlin D Meetup will be happening at 19:30 on this 
Friday September the 18th at Berlin Co-Op (http://co-up.de/) on 
the fifth floor.


This time Jens Mueller will be giving a talk on "Code tuning with 
D". A short introduction is below:


"In this talk we optimize a very simple algorithm implemented in 
the D programming language. The concrete example is chosen such 
that we can leave algorithmic and data structure issues aside and 
focus our attention on language related features to improve our 
coding and our code. As a consequence our code improvements will 
be fairly low level and less portable. Also we provide 
scaffolding to test and measure the performance of our code.


During the presentation we follow an engineering cycle and 
design, implement, test, and measure our code iteratively until 
we are happy and exhausted. This also gives the audience the 
possibility to participate and improve the code beyond the 
proposed solution.


I am looking forward to you joining me for some D coding."

Details are also on the meetup page here: 
http://www.meetup.com/Berlin-D-Programmers/


Thanks,
Ben.


Re: std.experimental.testing formal review

2015-09-15 Thread Atila Neves via Digitalmars-d

On Sunday, 13 September 2015 at 09:59:18 UTC, Dicebot wrote:
On Saturday, 12 September 2015 at 14:50:32 UTC, Jacob Carlborg 
wrote:

On 2015-09-12 15:34, Dicebot wrote:

I also don't like mixing unittest and higher level functional 
tests
(with setup and cleanup phases) into the same buckets - this 
doesn't fit
nice with D module system. Latter should be placed in a 
separate
modules/package to avoid being picked up by rdmd & Co when 
compiled as

dependency.


Not sure I understand the problem. Does this prevent one from 
writing functional tests in a completely separate directory?


On related topic - there are 2 things that are currently 
missing in `TestCase` when applied for functional test purpose:


1) being able to mark test case as fatal (i.e. if internal 
handshake or sanity check fails there is no point in trying to 
run other tests)


I'll see if I can add this before the end of the review phase.

2) being able to do weak ordering of tests (by defining strict 
sequence of groups so that parallelization/randomization only 
happens within such group) - I have used something as simple as 
numerical priority value so far for my needs


How about I change the name from @singleThreaded to @serial and 
make sure it works with randomised runs as well (it probably 
already does, I just have to check)?


Atila



Re: Implementing typestate

2015-09-15 Thread Freddy via Digitalmars-d

On Tuesday, 15 September 2015 at 17:45:45 UTC, Freddy wrote:

...


I just thought of some corner cases and how to solve them.
---
Disallow global variable with typestate (there might be a better 
solution down the line).
The evaluated typestate of variables after going through  
branches (if,for,etc...) must be the same.

Example
---
void func(){
File f;
if(someVar){
f.openWrite("a.txt");
}
//error here one branch where f is none, another branch where 
f is open

}
---


Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Andrew Brown via Digitalmars-d-learn
Thanks very much for your help, it seemed to work a treat (I hope 
:))! Compiling ldc wasn't too bad, make the changes to 
runtime/phobos/std/stdio.d and then just building as normal was 
no problem. Unittests are passing and it handles that file 
perfectly.


On Tuesday, 15 September 2015 at 16:11:06 UTC, Martin Krejcirik 
wrote:
On Tuesday, 15 September 2015 at 15:28:23 UTC, Andrew Brown 
wrote:
A very naive question: would it be possible in this case to 
backport it into gdc/ldc by copying the pull request and 
building the compiler from source, or would this get me into a 
world of pain?


Cherry-picking should work and merge cleanly. I have done it 
for DMD 2.067. I don't know how difficult it is to recompile 
Phobos and Druntime with LDC/GDC though.





Re: Type helpers instead of UFCS

2015-09-15 Thread BBasile via Digitalmars-d

On Tuesday, 15 September 2015 at 16:14:39 UTC, John Colvin wrote:

On Saturday, 12 September 2015 at 20:37:37 UTC, BBasile wrote:

[...]


How is this different to just having a specific type for the 
first argument?


void writeln(Args...)(string s, Args args)
{
static import std.stdio;
std.stdio.writeln(s, args);
}


Probably not much. Just forget this topic and let it fall into 
the black hole of memories...Already said previously that's 
probably not that a good idea.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Sep 15, 2015 at 08:55:43AM +, Fredrik Boulund via 
Digitalmars-d-learn wrote:
> On Monday, 14 September 2015 at 18:31:38 UTC, H. S. Teoh wrote:
> >I tried implementing a crude version of this (see code below), and
> >found that manually calling GC.collect() even as frequently as once
> >every 5000 loop iterations (for a 500,000 line test input file) still
> >gives about 15% performance improvement over completely disabling the
> >GC.  Since most of the arrays involved here are pretty small, the
> >frequency could be reduced to once every 50,000 iterations and you'd
> >pretty much get the 20% performance boost for free, and still not run
> >out of memory too quickly.
> 
> Interesting, I'll have to go through your code to understand exactly
> what's going on. I also noticed some GC-related stuff high up in my
> profiling, but had no idea what could be done about that. Appreciate
> the suggestions!

It's very simple, actually. Basically you just call GC.disable() at the
beginning of the program to disable automatic collection cycles, then at
period intervals in you manually trigger collections by calling
GC.collect().

The way I implemented it in my test code was to use a global counter
that I decrement once every loop iteration. When the counter reaches
zero, GC.collect() is called, and then the counter is reset to its
original value.  This is encapsulated in the gcTick() function, so that
it's easy to tweak the frequency of the manual collections without
modifying several different places in the code each time.


T

-- 
BREAKFAST.COM halted...Cereal Port Not Responding. -- YHL


Re: Implementing typestate

2015-09-15 Thread BBasile via Digitalmars-d

On Tuesday, 15 September 2015 at 18:15:46 UTC, Freddy wrote:

On Tuesday, 15 September 2015 at 18:10:06 UTC, BBasile wrote:

Ok, sorry I didn't know this concept so far.
So there would be a kind of 'compile-time instance' of File 
with a modifiable member ?


A simplified version of this: 
https://en.wikipedia.org/wiki/Typestate_analysis
Where types can have compile time state(enum) that change as 
they are used.


Ok, I see. So type states can be used in static analysis to find 
possible bugs if certain states-pattern are not found. In the 
file example if after FState.open, fState.close is never found 
then a compiler could emitt a warn about a possible leak or 
something...wow that's pretty edgy...


Re: Implementing typestate

2015-09-15 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 15 September 2015 at 18:25:51 UTC, BBasile wrote:

On Tuesday, 15 September 2015 at 18:15:46 UTC, Freddy wrote:

On Tuesday, 15 September 2015 at 18:10:06 UTC, BBasile wrote:

Ok, sorry I didn't know this concept so far.
So there would be a kind of 'compile-time instance' of File 
with a modifiable member ?


A simplified version of this: 
https://en.wikipedia.org/wiki/Typestate_analysis
Where types can have compile time state(enum) that change as 
they are used.


Ok, I see. So type states can be used in static analysis to 
find possible bugs if certain states-pattern are not found. In 
the file example if after FState.open, fState.close is never 
found then a compiler could emitt a warn about a possible leak 
or something...wow that's pretty edgy...


It is the same type of concept. Typestate, effect system, linear 
typing, behavioural typing. It is no doubt the future for type 
systems, but also demanding. I've tried to raise awareness about 
it before, but no takers:


http://forum.dlang.org/post/ovoarcbexpvrrceys...@forum.dlang.org



Re-named & Selective Imports

2015-09-15 Thread jmh530 via Digitalmars-d-learn
I combined a re-named import with a selective import and was 
surprised to find that it didn't do what I would have expected. 
In the code below, I would have expected only the "test2" line to 
have compiled, but it turned out that all three of these do. I'm 
guessing the logic is that it imports all of std.stdio, re-names 
it as io, then puts just std.stdio.writeln in the namespace.


import io = std.stdio : writeln;

void main()
{
writeln("test1");
io.writeln("test2");
io.write("test3", '\n');
}

It seems like it might be a bit more intuitive if they had 
disabled selective imports with re-named imports (like with 
static imports). Then you could do a separate selective import. 
This would probably be more clear.


As far as I can tell, if you do selective imports of a function 
with the same name from two different modules, then you have to 
give one a unique name without any module prefix. For instance, I 
tried to import with
import std.stdio : writeln, io.writeln = writeln;, but that 
doesn't work, but something like io_writeln would.





Re: DUB release candidate 0.9.24-rc.3 ready for testing

2015-09-15 Thread Nick Sabalausky via Digitalmars-d

On 09/14/2015 07:45 AM, Sönke Ludwig wrote:

SDLang [1]
[...]
[1]: http://sdl.ikayzo.org/display/SDL/Home


That site is down at the moment (I've contacted the owner). But in the 
meantime, a mirror of the site is available at The Wayback Machine 
(web.archive.org):


https://web.archive.org/web/20150511173850/http://sdl.ikayzo.org/display/SDL/Home



Re: Checking for Homogeneous Tuples

2015-09-15 Thread John Colvin via Digitalmars-d-learn

On Tuesday, 15 September 2015 at 16:54:22 UTC, Nordlöw wrote:
How do I check that all the elements of a std.typecons.Tuple 
all fulfil a specific predicate, in my case all have a specific 
type:


Something like

import std.typecons : isTuple;
enum isTupleOf(T, E) = isTuple!T && is(MAGIC(T, E));


std.meta.allSatisfy!(SomePredicateTemplate, T.Types);


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Andrew Brown via Digitalmars-d-learn
I had some luck building a local copy of llvm in my home 
directory, using a linux version about as old as yours (llvm 3.5 
i used) specifying:


--configure --prefix=/home/andrew/llvm

so make install would install it somewhere I had permissions.

Then I changed the cmake command to:

cmake -L -DLLVM_CONFIG="/home/andrew/llvm/bin/llvm-config" ..

and I got a working install of ldc.

Make yourself a cup of tea while you wait though if you try it, 
llvm was about an hour and a half to compile.


On Tuesday, 15 September 2015 at 13:49:04 UTC, Fredrik Boulund 
wrote:
On Tuesday, 15 September 2015 at 10:01:30 UTC, John Colvin 
wrote:
try this: 
https://dlangscience.github.io/resources/ldc-0.16.0-a2_glibc2.11.3.tar.xz


Nope, :(

$ ldd ldc2
./ldc2: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not 
found (required by ./ldc2)

linux-vdso.so.1 =>  (0x7fff2ffd8000)
libpthread.so.0 => /lib64/libpthread.so.0 
(0x00318a00)

libdl.so.2 => /lib64/libdl.so.2 (0x00318a40)
libncurses.so.5 => /lib64/libncurses.so.5 
(0x00319bc0)

librt.so.1 => /lib64/librt.so.1 (0x00318a80)
libz.so.1 => /lib64/libz.so.1 (0x00318ac0)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 
(0x00318dc0)

libm.so.6 => /lib64/libm.so.6 (0x003189c0)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 
(0x00318c00)

libc.so.6 => /lib64/libc.so.6 (0x00318980)
/lib64/ld-linux-x86-64.so.2 (0x00318940)
libtinfo.so.5 => /lib64/libtinfo.so.5 
(0x00319900)


Thanks for trying though!





Re: Checking for Homogeneous Tuples

2015-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn
If it is a tuple of values too, you could just try to form an 
array out of it: `static if (__traits(compiles, [your_tuple]))`. 
But allSatisfy might be better.


For the predicate there, remember it needs to take a template 
argument.


[Issue 15062] New: ElementType Causes Abnormally Long Compile Time

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15062

  Issue ID: 15062
   Summary: ElementType Causes Abnormally Long Compile Time
   Product: D
   Version: D2
  Hardware: x86
OS: Windows
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: monkeywork...@hotmail.com

import std.range;
import std.array;
import std.conv;
import std.algorithm;
import std.string;
import std.stdio;

enum Instructions: ushort
{
add = 123,
sub = 124,
}

uint[ushort.max] inst;

void initInst()
{
//Removing this line drastically reduces compile time
alias InstElem = ElementType!(typeof(inst));
}

void main()
{
}

--


Re: Implementing typestate

2015-09-15 Thread Freddy via Digitalmars-d

On Tuesday, 15 September 2015 at 17:57:10 UTC, BBasile wrote:


This won't work in D. Everything that's static is common to 
each instance.
What's possible however is to use an immutable FState that's 
set in the ctor.


---
struct File
{
immutable FState state,
this(string fname, FState st){state = st}
}
---

Than you're sure that your file state can't be changed by error.
Otherwise just hide the state to set it as a private variable...


No, I'm talking about adding a new feature to the language, 
modifable enums(typestate).


Re: Implementing typestate

2015-09-15 Thread BBasile via Digitalmars-d

On Tuesday, 15 September 2015 at 17:45:45 UTC, Freddy wrote:
Would it be worth implementing some kind of typestate into the 
language?

By typestate I mean a modifiable enum.

For example:
---
enum FState
{
none,
read,
write
}

struct File
{
//maybe another keyword other than enum
enum state = FState.none;

void openRead(string name)
{
//evalutaed in a way similar to static if
state = FState.read;
//...
}

void openWrite(string name)
{
state = FState.write;
//...
}

ubyte[] read(size_t) if (state == FState.read)
{
//...
}

void write(ubyte[]) if (state == FState.write)
{
//...
}
}

unittest
{
File f;
static assert(f.state == FState.none);
f.openRead("a.txt");
static assert(f.state == FState.read);
auto data = f.read(10);
}
---

We could use this "typestate" to implement:
 Rust style memory management in a library
 Safer Files (as shown)
 Possibly other ideas

Thoughts?


This won't work in D. Everything that's static is common to each 
instance.
What's possible however is to use an immutable FState that's set 
in the ctor.


---
struct File
{
immutable FState state,
this(string fname, FState st){state = st}
}
---

Than you're sure that your file state can't be changed by error.
Otherwise just hide the state to set it as a private variable...


Re: Implementing typestate

2015-09-15 Thread BBasile via Digitalmars-d

On Tuesday, 15 September 2015 at 17:59:19 UTC, Freddy wrote:

On Tuesday, 15 September 2015 at 17:57:10 UTC, BBasile wrote:


This won't work in D. Everything that's static is common to 
each instance.
What's possible however is to use an immutable FState that's 
set in the ctor.


---
struct File
{
immutable FState state,
this(string fname, FState st){state = st}
}
---

Than you're sure that your file state can't be changed by 
error.
Otherwise just hide the state to set it as a private 
variable...


No, I'm talking about adding a new feature to the language, 
modifable enums(typestate).


Ok, sorry I didn't know this concept so far.
So there would be a kind of 'compile-time instance' of File with 
a modifiable member ?




Re: No -v or -deps for gdc?

2015-09-15 Thread Johannes Pfau via Digitalmars-d-learn
Am Tue, 15 Sep 2015 12:19:34 +
schrieb Atila Neves :

> gdmd supports those options but gdc doesn't. Is that likely to 
> always be the case?
> 
> Atila

gdmd is just a wrapper around gdc. If something is supported by gdmd it
must also be supported by gdc (the exact switch names might differ).

See:
https://github.com/D-Programming-GDC/GDMD/blob/master/dmd-script

Seems like -v maps to -fd-verbose and -deps to -fdeps.


Re: Implementing typestate

2015-09-15 Thread Freddy via Digitalmars-d

On Tuesday, 15 September 2015 at 18:10:06 UTC, BBasile wrote:

Ok, sorry I didn't know this concept so far.
So there would be a kind of 'compile-time instance' of File 
with a modifiable member ?


A simplified version of this: 
https://en.wikipedia.org/wiki/Typestate_analysis
Where types can have compile time state(enum) that change as they 
are used.


Re: std.experimental.testing formal review

2015-09-15 Thread Dicebot via Digitalmars-d

On Sunday, 13 September 2015 at 10:44:30 UTC, Atila Neves wrote:
2) being able to do weak ordering of tests (by defining strict 
sequence of groups so that parallelization/randomization only 
happens within such group) - I have used something as simple 
as numerical priority value so far for my needs


There's `@singleThreaded` for that: all tests in a module with 
that UDA run in series (other modules are still run in 
parallel). I didn't think one was needed for random ordering.


Atila


I had inverse thing in mind - all tests within a module / block 
run in parallel, but blocks run sequentially. It is not a good 
feature for unit tests but quite important one to higher level 
ones which deal with nasty environment issues.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Rikki Cattermole via Digitalmars-d-learn

On 15/09/15 9:00 PM, Kagamin wrote:

On Tuesday, 15 September 2015 at 08:51:02 UTC, Fredrik Boulund wrote:

Using char[] all around might be a good idea, but it doesn't seem like
the string conversions are really that taxing. What are the arguments
for working on char[] arrays rather than strings?


No, casting to string would be incorrect here because the line buffer is
reused, your original usage of to!string is correct.


I made the assumption it wasn't allocating. Ehhh.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread John Colvin via Digitalmars-d-learn

On Tuesday, 15 September 2015 at 09:09:00 UTC, Kagamin wrote:
On Tuesday, 15 September 2015 at 08:53:37 UTC, Fredrik Boulund 
wrote:

my favourite for streaming a file:
enum chunkSize = 4096;
File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner()


Is this an efficient way of reading this type of file? What 
should one keep in mind when choosing chunkSize?


reasonably efficient, yes. See http://stackoverflow.com/a/237495 
for a discussion of chunk sizing when streaming a file.


It provides you only one char at a time instead of a whole 
line. It will be quite constraining for your code if not 
mind-bending.


http://dlang.org/phobos/std_string.html#.lineSplitter

File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner().lineSplitter()


Re: Release D 2.068.1

2015-09-15 Thread John Colvin via Digitalmars-d-announce

On Monday, 14 September 2015 at 23:53:16 UTC, Martin Nowak wrote:
On Monday, 14 September 2015 at 20:14:45 UTC, Jack Stouffer 
wrote:
On Monday, 14 September 2015 at 17:51:59 UTC, Martin Nowak 
wrote:

What platform are you on?


I'm on OS X, using the homebrew version of DMD. And homebrew 
is telling me that I have 2.068.1 installed


Well I guess it's a bug in the homebrew script then.
Nobody is setting the VERSION file and there is no git repo to 
query.

https://github.com/Homebrew/homebrew/blob/f8b0ff3ef63e60a1da17ec8d8e68d949b1cebc27/Library/Formula/dmd.rb#L50


Where is the VERSION file documented? Why does it need manual 
intervention only for patch releases and pre-releases?


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Fredrik Boulund via Digitalmars-d-learn

On Monday, 14 September 2015 at 18:31:38 UTC, H. S. Teoh wrote:
I tried implementing a crude version of this (see code below), 
and found that manually calling GC.collect() even as frequently 
as once every 5000 loop iterations (for a 500,000 line test 
input file) still gives about 15% performance improvement over 
completely disabling the GC.  Since most of the arrays involved 
here are pretty small, the frequency could be reduced to once 
every 50,000 iterations and you'd pretty much get the 20% 
performance boost for free, and still not run out of memory too 
quickly.


Interesting, I'll have to go through your code to understand 
exactly what's going on. I also noticed some GC-related stuff 
high up in my profiling, but had no idea what could be done about 
that. Appreciate the suggestions!




Re: Implement the "unum" representation in D ?

2015-09-15 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 15 September 2015 at 08:24:30 UTC, ponce wrote:
However if unum aren't fast, they will be only for prototyping 
and the real algorithm would rely on IEEE floats with different 
precision characteristics, so yeah hardware is critical.



I think he is looking into 32 bit floats for a simpler version of 
the concept combined with the "ubox" method (multidimensional 
interval representation that "brute force" the answer). The 
"uboxing" is visualized here:


http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPrecision1.pdf



Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Fredrik Boulund via Digitalmars-d-learn
On Monday, 14 September 2015 at 16:13:14 UTC, Edwin van Leeuwen 
wrote:
See this link for clarification on what the columns/numbers in 
the profile file mean

http://forum.dlang.org/post/f9gjmo$2gce$1...@digitalmars.com

It is still difficult to parse though. I myself often use 
sysprof (only available on linux), which automatically ranks by 
time spent.


Thanks for the link. I read up on what everything means, but I 
think the problem isn't finding what consumes the most time, the 
problem is me not knowing the standard library well enough to 
translate the largest consumers to actual parts of my code :).


Compilation error

2015-09-15 Thread Loic via Digitalmars-d-learn


Hello,

I hope it's the good place to ask my question.

I'am trying an hello world program in D, unfortunately the 
compilation, doesn't work, and found nothing on google.


when I do : dmd Hello.d, the error returned is

Error: cannot find source code for runtime library file 'object.d'
dmd might not be correctly installed. Run 'dmd -man' for 
installation instructions.

config file: C:\D\dmd2\windows\bin\sc.ini
Specify path to file 'object.d' with -I switch

My machine is Windows 7 64 bits DMD2 and DMC are installed.

Thank you

Loic


Re: Implement the "unum" representation in D ?

2015-09-15 Thread ponce via Digitalmars-d

On Tuesday, 15 September 2015 at 07:57:01 UTC, deadalnix wrote:

On Tuesday, 15 September 2015 at 07:07:20 UTC, ponce wrote:

On Tuesday, 15 September 2015 at 05:16:53 UTC, deadalnix wrote:


The guy seems to have good credential. Why should I read that 
book ?


The sample chapter dissipates a bit the marketing cloud.
One of the ideas is that the imprecise bit encode an interval 
between 2 values, hence automatically computing the 
"precision" of a computation without analysis.


Read it. That is suddenly much less impressive, but much more 
sensible.


I can see this being useful since nowadays in the native space we 
often choose between single and double precision with ad-hoc oral 
rules and learned habits rather than measuring precision.


However if unum aren't fast, they will be only for prototyping 
and the real algorithm would rely on IEEE floats with different 
precision characteristics, so yeah hardware is critical.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 08:53:37 UTC, Fredrik Boulund 
wrote:

my favourite for streaming a file:
enum chunkSize = 4096;
File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner()


Is this an efficient way of reading this type of file? What 
should one keep in mind when choosing chunkSize?


It provides you only one char at a time instead of a whole line. 
It will be quite constraining for your code if not mind-bending.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Fredrik Boulund via Digitalmars-d-learn

On Monday, 14 September 2015 at 15:04:12 UTC, John Colvin wrote:


I've had nothing but trouble when using different versions of 
libc. It would be easier to do this instead: 
http://wiki.dlang.org/Building_LDC_from_source


I'm running a build of LDC git HEAD right now on an old server 
with 2.11, I'll upload the result somewhere once it's done if 
it might be useful


Thanks for the offer, but don't go out of your way for my sake. 
Maybe I'll just build this in a clean environment instead of on 
my work computer to get rid of all the hassle. The Red Hat 
llvm-devel packages are broken, dependent on libffi-devel which 
is unavailable. Getting the build environment up to speed on my 
main machine would take me a lot more time than I have right now.


Tried building LDC from scratch but it fails because of missing 
LLVM components, despite having LLVM 3.4.2 installed (though 
lacking devel components).


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Fredrik Boulund via Digitalmars-d-learn

On Monday, 14 September 2015 at 18:08:31 UTC, John Colvin wrote:
On Monday, 14 September 2015 at 17:51:43 UTC, CraigDillabaugh 
wrote:
On Monday, 14 September 2015 at 12:30:21 UTC, Fredrik Boulund 
wrote:

[...]


I am going to go off the beaten path here.  If you really want 
speed
for a file like this one way of getting that is to read the 
file
in as a single large binary array of ubytes (or in blocks if 
its too big)
and parse the lines yourself. Should be fairly easy with D's 
array slicing.


my favourite for streaming a file:
enum chunkSize = 4096;
File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner()


Is this an efficient way of reading this type of file? What 
should one keep in mind when choosing chunkSize?


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Fredrik Boulund via Digitalmars-d-learn
On Monday, 14 September 2015 at 16:33:23 UTC, Rikki Cattermole 
wrote:


A lot of this hasn't been covered I believe.

http://dpaste.dzfl.pl/f7ab2915c3e1

1) You don't need to convert char[] to string via to. No. Too 
much. Cast it.
2) You don't need byKey, use foreach key, value syntax. That 
way you won't go around modifying things unnecessarily.


Ok, I disabled GC + reserved a bunch of memory. It probably 
won't help much actually. In fact may make it fail so keep that 
in mind.


Humm what else.

I'm worried about that first foreach. I don't think it needs to 
exist as it does. I believe an input range would be far better. 
Use a buffer to store the Hit[]'s. Have a subset per set of 
them.


If the first foreach is an input range, then things become 
slightly easier in the second. Now you can turn that into it's 
own input range.
Also that .array usage concerns me. Many an allocation there! 
Hence why the input range should be the return from it.


The last foreach, is lets assume dummy. Keep in mind, stdout is 
expensive here. DO NOT USE. If you must buffer output then do 
it large quantities.



Based upon what I can see, you are definitely not able to use 
your cpu's to the max. There is no way that is the limiting 
factor here. Maybe your usage of a core is. But not the cpu's 
itself.


The thing is, you cannot use multiple threads on that first 
foreach loop to speed things up. No. That needs to happen all 
on one thread.
Instead after that thread you need to push the result into 
another.


Perhaps, per thread one lock (mutex) + buffer for hits. Go 
round robin over all the threads. If mutex is still locked, 
you'll need to wait. In this situation a locked mutex means all 
you worker threads are working. So you can't do anything more 
(anyway).


Of course after all this, the HDD may still be getting hit too 
hard. In which case I would recommend you memory mapping it. 
Which should allow the OS to more efficiently handle reading it 
into memory. But you'll need to rework .byLine for that.



Wow that was a lot at 4:30am! So don't take it too seriously. 
I'm sure somebody else will rip that to shreds!


Thanks for your suggestions! That sure is a lot of details. I'll 
have to go through them carefully to understand what to do with 
all this. Going multithreaded sounds fun but would  effectively 
kill of all of my spare time, so I might have to skip that. :)


Using char[] all around might be a good idea, but it doesn't seem 
like the string conversions are really that taxing. What are the 
arguments for working on char[] arrays rather than strings?


I'm aware that printing output like that is a performance killer, 
but it's not supposed to write anything in the final program. 
It's just there for me to be able to compare the results to my 
Python code.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 08:51:02 UTC, Fredrik Boulund 
wrote:
Using char[] all around might be a good idea, but it doesn't 
seem like the string conversions are really that taxing. What 
are the arguments for working on char[] arrays rather than 
strings?


No, casting to string would be incorrect here because the line 
buffer is reused, your original usage of to!string is correct.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 08:45:00 UTC, Fredrik Boulund 
wrote:

On Monday, 14 September 2015 at 15:04:12 UTC, John Colvin wrote:

[...]


Thanks for the offer, but don't go out of your way for my sake. 
Maybe I'll just build this in a clean environment instead of on 
my work computer to get rid of all the hassle. The Red Hat 
llvm-devel packages are broken, dependent on libffi-devel which 
is unavailable. Getting the build environment up to speed on my 
main machine would take me a lot more time than I have right 
now.


Tried building LDC from scratch but it fails because of missing 
LLVM components, despite having LLVM 3.4.2 installed (though 
lacking devel components).


try this: 
https://dlangscience.github.io/resources/ldc-0.16.0-a2_glibc2.11.3.tar.xz


Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn

For reference, it was this PR:
https://github.com/D-Programming-Language/phobos/pull/3089
which fixed the same issue for me.



[Issue 15058] [VisualD] A way to specify Debugging Current Directory from within the .visualdproj

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15058

ponce  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from ponce  ---
 worked, like Sönke predicted.

--


Re: French translation of Ali Çehreli's "Programming in D" book : 53 chapter translated

2015-09-15 Thread Ali Çehreli via Digitalmars-d-announce

On 09/15/2015 05:20 AM, Andre Polykanine via Digitalmars-d-announce wrote:

> I   tried   to   contact   Ali  privately  about  Russian and possibly
> Ukrainian translation

That's wonderful! :) Thank you for considering that.

> unfortunately got no response(

That's horrible! :( The email must have been lost. (If your name appers 
in the email I can't find it in my Inbox.)


The book (and unrelated other website stuff) are all at this repo:

  https://bitbucket.org/acehreli/ddili

The README should be sufficient to get you started. (Although, the 
experimental 'diet' branch is not mentioned in there. Just focus on the 
'master' branch.)


Ali



Re: Type helpers instead of UFCS

2015-09-15 Thread John Colvin via Digitalmars-d

On Saturday, 12 September 2015 at 20:37:37 UTC, BBasile wrote:

UFCS is good but there are two huge problems:
- code completion in IDE. It'will never work.
- noobs, code is unreadable.

That's why I propose the new keywords 'helper' and 'subject' 
that will allow to extend the properties pre-defined for a 
type, as long as the helper is imported:


---
module myhelper;
helper for subject : string
{
void writeln()
{
import std.stdio;
writeln(subject);
}
}
---

this will allow IDE plugins to provide better completion.

for example if 'Peter' types

---
void foo()
{
import myhelper;
"foobarbaz".
}
---

after the dot, 'Peter' can get ".writeln".
Why ? because a clear grammatical construction will allow an 
IDE plugin to work on a type and provides additional helpers 
that would be hard to put in the list without any specific 
grammatical construction.


...


How is this different to just having a specific type for the 
first argument?


void writeln(Args...)(string s, Args args)
{
static import std.stdio;
std.stdio.writeln(s, args);
}


Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn

On Tuesday, 15 September 2015 at 15:28:23 UTC, Andrew Brown wrote:
A very naive question: would it be possible in this case to 
backport it into gdc/ldc by copying the pull request and 
building the compiler from source, or would this get me into a 
world of pain?


Cherry-picking should work and merge cleanly. I have done it for 
DMD 2.067. I don't know how difficult it is to recompile Phobos 
and Druntime with LDC/GDC though.


Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 13:49:04 UTC, Fredrik Boulund 
wrote:
On Tuesday, 15 September 2015 at 10:01:30 UTC, John Colvin 
wrote:

[...]


Nope, :(

[...]


Oh well, worth a try I guess.


Re: Compilation error

2015-09-15 Thread Loic via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 12:37:46 UTC, Adam D. Ruppe 
wrote:

On Tuesday, 15 September 2015 at 09:17:26 UTC, Loic wrote:
Error: cannot find source code for runtime library file 
'object.d'


How did you install dmd? The installer exe or the zip both 
should have come with all these files packaged together.


Hello Adam,

I installed with the exe installer, and set my path to 
C:\D\dmd2\windows\bin

Maybe I forget to configure some file(s) ?

Thank you

Loic


Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Andrew Brown via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 14:55:42 UTC, Martin Krejcirik 
wrote:

For reference, it was this PR:
https://github.com/D-Programming-Language/phobos/pull/3089
which fixed the same issue for me.


A very naive question: would it be possible in this case to 
backport it into gdc/ldc by copying the pull request and building 
the compiler from source, or would this get me into a world of 
pain?


[Issue 14858] spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14858

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/803da8f10c0c5d09da5b19274ba1a1b9763d5e03
fix Issue 14858 - spurious "Error: overload alias 'foo' is not a variable" when
overloading template and non-template via aliases

https://github.com/D-Programming-Language/dmd/commit/e91a6ac45b6adc2d8080df14caca0b62cad19a9b
Merge pull request #4857 from 9rnsr/fix14858

Issue 14858 - spurious "Error: overload alias 'foo' is not a variable" when
overloading template and non-template via aliases

--


[Issue 14858] spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases

2015-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14858

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


Re: French translation of Ali Çehreli's "Programming in D" book : 53 chapter translated

2015-09-15 Thread Andre Polykanine via Digitalmars-d-announce
Hello Raphaël,
Sorry for the off topic, but how do you translate the book?
I   tried   to   contact   Ali  privately  about  Russian and possibly
Ukrainian translation (I'm
interested  in  doing  this just for the sake of spreading D and don't
expect any revenue), but unfortunately got no response(
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: @m_elensule; Facebook: menelion
My blog: http://menelion.oire.org/


 Original message 
From: Raphaël Jakse via Digitalmars-d-announce 

To: digitalmars-d-announce@puremagic.com
Date created: , 2:40:57 PM
Subject: French translation of Ali Çehreli's "Programming in D" book : 53 
chapter translated


  Hello,

A few words to the D community to give news about the French translation 
of Ali Çehreli's "Programming in D" book.

Thanks to Oliver Pisano (translator) and Stéphane Goujet (proofreader), 
the translation is still alive. 53 chapters are translated and most have 
been proofread.

Thanks to Théo Bueno for hosting the translation.

There are 38 chapters pending for translation. If you speak French and 
you want to help, don't hesitate to contact me.

http://dlang-fr.org/cours/programmer-en-d/




French translation of Ali Çehreli's "Programming in D" book : 53 chapter translated

2015-09-15 Thread Raphaël Jakse via Digitalmars-d-announce

Hello,

A few words to the D community to give news about the French translation 
of Ali Çehreli's "Programming in D" book.


Thanks to Oliver Pisano (translator) and Stéphane Goujet (proofreader), 
the translation is still alive. 53 chapters are translated and most have 
been proofread.


Thanks to Théo Bueno for hosting the translation.

There are 38 chapters pending for translation. If you speak French and 
you want to help, don't hesitate to contact me.


http://dlang-fr.org/cours/programmer-en-d/


Re: Implement the "unum" representation in D ?

2015-09-15 Thread ponce via Digitalmars-d
On Tuesday, 15 September 2015 at 09:35:36 UTC, Ola Fosheim 
Grøstad wrote:

http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPrecision1.pdf


That's a pretty convincing case. Who does it :)?




Re: Implement the "unum" representation in D ?

2015-09-15 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 15 September 2015 at 10:38:23 UTC, ponce wrote:
On Tuesday, 15 September 2015 at 09:35:36 UTC, Ola Fosheim 
Grøstad wrote:

http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPrecision1.pdf


That's a pretty convincing case. Who does it :)?


You:9

https://github.com/jrmuizel/pyunum/blob/master/unum.py



No -v or -deps for gdc?

2015-09-15 Thread Atila Neves via Digitalmars-d-learn
gdmd supports those options but gdc doesn't. Is that likely to 
always be the case?


Atila


Re: Beta D 2.068.2-b2

2015-09-15 Thread Meta via Digitalmars-d-announce

On Monday, 14 September 2015 at 21:05:42 UTC, Martin Nowak wrote:
The second beta for the 2.068.2 point release fixes an 
regression with destroy that could result in a memory leak [¹].


http://downloads.dlang.org/pre-releases/2.x/2.068.2/

-Martin

[¹]: https://issues.dlang.org/show_bug.cgi?id=15044


I believe I've found a compiler performance bug (or regression, I 
don't have any other compiler versions to test on right now). The 
following programming takes an abnormally long times to compile 
on 2.068.1 and 2.068.2:


import std.range;
import std.array;
import std.conv;
import std.algorithm;
import std.string;
import std.stdio;

enum Instructions: ushort
{
add = 123,
sub = 124,
}

uint[ushort.max] inst;

void initInst()
{
//Removing this line drastically reduces compile time
alias InstElem = ElementType!(typeof(inst));
}

void main()
{
}

https://issues.dlang.org/show_bug.cgi?id=15062


tkd not linking

2015-09-15 Thread karabuta via Digitalmars-d-learn
I have tried several times to compile tkd using dub but I keep 
getting this message:


Linking...
/usr/bin/ld: cannot find -ltcl
/usr/bin/ld: cannot find -ltk
collect2: error: ld returned 1 exit status
--- errorlevel 1
FAIL 
.dub/build/application-debug-linux.posix-x86-dmd_2068-4989C12BA459945625492BF92EAC638A/ tkdapps executable

Error executing command run:
dmd failed with exit code 1.


I use Ubuntu 14.04 x32. Here is the dub.json file content

{
"name": "tkdapps",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, karabuta",
"authors": ["karabuta"],
"dependencies": {
"tcltk": "8.6.5",
"tkd": "1.1.4"
}
}

Just incase, I have install version 8.6 of the Tcl/Tk libraries

What is the problem. And how is tcltk different from tkd in the 
first place?




Re: Checking for Homogeneous Tuples

2015-09-15 Thread Meta via Digitalmars-d-learn

On Tuesday, 15 September 2015 at 16:54:22 UTC, Nordlöw wrote:
How do I check that all the elements of a std.typecons.Tuple 
all fulfil a specific predicate, in my case all have a specific 
type:


Something like

import std.typecons : isTuple;
enum isTupleOf(T, E) = isTuple!T && is(MAGIC(T, E));


I made a pull request for this a long time ago but it was 
rejected.


https://github.com/D-Programming-Language/phobos/pull/1672


Re: Type helpers instead of UFCS

2015-09-15 Thread Tina via Digitalmars-d

On Saturday, 12 September 2015 at 20:50:01 UTC, BBasile wrote:
On Saturday, 12 September 2015 at 20:40:35 UTC, Adam D. Ruppe 
wrote:

On Saturday, 12 September 2015 at 20:37:37 UTC, BBasile wrote:

- code completion in IDE. It'will never work.


Why not? I haven't actually tried it, but it seems like a 
pretty easy problem, except perhaps with complex templates.



- noobs, code is unreadable.


meh


meh too.


It's "me"


Re: Operator overloading or alternatives to expression templates

2015-09-15 Thread Andrei Alexandrescu via Digitalmars-d

On 09/14/2015 03:35 PM, Timon Gehr wrote:

On 09/14/2015 08:09 PM, Andrei Alexandrescu wrote:

On 09/13/2015 10:06 AM, Martin Nowak wrote:

...
- language regularization

   It's surprising to find these "arbitrary" language limitations.
   The non-predictability of what's possible has always been a huge
issue
for me with C++, i.e. you come up with an idea, spend 4 hours
implementing it only to find out that the small detail x isn't feasible.


This is the case in all powerful languages.


That's an overgeneralization.


Aren't they all :o).


Furthermore, having arbitrary designed-in irregularities is not
comparable to implementing a system whose emergent behavior is not
understood sufficiently well. (D is guilty of both, but the former is
much easier to fix than the latter.)


Martin Odersky told me there's a constant problem with Scala ...


Both C++ and Scala have accidentally Turing-complete type systems.


I think what I'm trying to say is "I'm trying to do this very advanced 
thing and the language support is insufficient" is the kind of argument 
that needs to be made and taken with caution.



Andrei


Checking for Homogeneous Tuples

2015-09-15 Thread Nordlöw via Digitalmars-d-learn
How do I check that all the elements of a std.typecons.Tuple all 
fulfil a specific predicate, in my case all have a specific type:


Something like

import std.typecons : isTuple;
enum isTupleOf(T, E) = isTuple!T && is(MAGIC(T, E));




Re: std.experimental.testing formal review

2015-09-15 Thread Atila Neves via Digitalmars-d

On Tuesday, 15 September 2015 at 08:27:29 UTC, Dicebot wrote:

On Sunday, 13 September 2015 at 10:44:30 UTC, Atila Neves wrote:
2) being able to do weak ordering of tests (by defining 
strict sequence of groups so that 
parallelization/randomization only happens within such group) 
- I have used something as simple as numerical priority value 
so far for my needs


There's `@singleThreaded` for that: all tests in a module with 
that UDA run in series (other modules are still run in 
parallel). I didn't think one was needed for random ordering.


Atila


I had inverse thing in mind - all tests within a module / block 
run in parallel, but blocks run sequentially. It is not a good 
feature for unit tests but quite important one to higher level 
ones which deal with nasty environment issues.


I'm not sure we're understanding each other. With the current
implementation and a module like this:

@singleThreaded
@name("serial1") unittest { ... }

@singleThreaded
@name("serial2") unittest { ... }

@name("parallel1") unittest {... }
@name("parallel2") unittest { ...}


3 tasks would get scheduled in parallel: parallel1, parallel2, 
and a composite task that does serial1 then serial2. If there are 
any other modules, all of the other tests run in parallel with 
these 3 tasks.


I'm proposing to extend the same behaviour to randomised running 
of tests, but if that's the case the name would change.


Atila


  1   2   >