Re: Opinions: The Best and Worst of D (for a lecture/talk I intend to give)

2014-07-08 Thread Philippe Sigaud via Digitalmars-d-learn
On Tue, Jul 8, 2014 at 7:50 AM, H. S. Teoh via Digitalmars-d-learn
 wrote 

Wow, what to add to that? Maybe you scared other from participating ;-)

* I'll second metaprogramming: the alliance between templates, CTFE
and mixins is really nice. It's *the* feature (or triplet of features)
I think of when Walter says that many D parts are kind of "what for?"
in isolation but really grow into something awesome by using one
another.

* I'd add static introspection to the mix: using static if,
__traits(...) and is(...), clunky as the syntax is (there, one 'ugly'
thing for you), is easy and very powerful: the idea to have code
selecting its flow or extracting information (is that a static array?
Does this aggregate have an '.empty' method?). This is the basis for
std.algorithm idiom of 'static interface' which allows us compile-time
duck typing, which I find very pleasing.

* unittests are nice of course, H. S. Teoh already said it
expressively enough :-)

* I'd add arrays and slice. They are wonderfully simple to use,
efficient, etc. I remember learning D by translating the Euler Project
problems from C++ to D and it was a joy.

Which brings me to another feature I like: ranges. The idea is nothing
new, but I find it quite well-realized in D, far easier than other
compiled languages alternatives and since they are pervasive in the
library, you can really plug components into one another nicely.

For example:
http://wiki.dlang.org/Component_programming_with_ranges#Case_Study:_Formatting_a_Calendar

* dub is good, and you can show code.dlang.org in your presentation.

* Bonus point: different compilers. I like that. I regularly use at
least two in parallel while developping (comparing results, speed,
etc). Kudos to all the guys involved!



As for the bad and ugly:

* it's frustrating not to have a big collection module in Phobos, but
then I didn't propose one, so I'll shut up.
* there are still some not so nice interaction between
const/shared/inout/ auto ref, though I rarely hit them these days
* The compiler still has some quirks: I find it strange you can put
unused qualifiers in many places.

But very honestly, it was already a joy to use a few years ago, and
it's becoming better and better.


Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-08 Thread Jesse Phillips via Digitalmars-d-learn

On Monday, 7 July 2014 at 16:02:33 UTC, Kagamin wrote:

On Monday, 7 July 2014 at 14:25:54 UTC, Regan Heath wrote:
If I had to guess, I would say it would still be possible to 
access the file.


It's documented so. I guess, linux implements file deletion 
with delete-on-close feature too, if it exists, a separate 
deletion operation is not needed.


It's not really a delete on close. The file system link is 
removed, but there is still a handle open to the location. This 
ends up working more like a GC, file is not returned for reuse 
until there are no more references to it.


Re: Passing Templated Function Arguments Solely by Reference

2014-07-08 Thread Nordlöw

On Wednesday, 9 July 2014 at 00:13:41 UTC, Nordlöw wrote:

Searching for

"Function Templates with Auto Ref Parameters"

on http://dlang.org/template.html answered my first question.

I'm however still uncertain how to implement randInPlace in the 
most D idiomatic way.


Passing Templated Function Arguments Solely by Reference

2014-07-08 Thread Nordlöw
If I want randInPlace to take value arguments (such as structs) 
by reference and reference types (classes) as normal is this


/** Generate Random Contents in $(D x).
 */
auto ref randInPlace(T)(auto ref T x) @safe /* nothrow */ if 
(isIterable!T)

{
foreach (ref elt; x)
{
import std.range: ElementType;
static if (isInputRange!(ElementType!T))
elt[].randInPlace;
else
elt.randInPlace;
}
return x;
}

the way to do it or does

auto ref T x

evaluate to unnecessary

ref Class x

?

And isIterable the recommended way to do it?

And how does this compare to using x[].randInPlace() when x is a 
static array? Does x[] create unnecessary GC-heap activity in 
this case?


I'm wondering because (auto ref T x) is just used in two places 
in std.algorithm and std.range in Phobos. Is this a relatively 
new enhancement?


Re: Tuple and tie?

2014-07-08 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 08, 2014 at 07:46:14PM +, anonymous via Digitalmars-d-learn 
wrote:
> On Tuesday, 8 July 2014 at 19:40:59 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> > template TypesOf(T...)
> > {
> > static if (T.length == 1)
> > alias TypesOf = typeof(T[0]);
> > else
> > alias TypesOf = TypeTuple!(typeof(T[0]), 
> > TypesOf!(T[1..$]));
> > }
> > 
> > @property void tie(T...)(Tuple!(TypesOf!T) t)
> [...]
> >It does involve some slightly more arcane template magic, though. ;-)
> >Basically, the TypesOf template transforms a list of alias arguments
> >into a list of the types of said arguments, so that we can match a
> >list of variables to the Tuple that is to be assigned to them.
> 
> typeof(T) would work, too.

You're right! Shows how much I don't know, I guess. :P


T

-- 
There's light at the end of the tunnel. It's the oncoming train.


Quicksort Variants

2014-07-08 Thread Nordlöw

After having read

http://togototo.wordpress.com/2014/06/20/the-magic-forest-problem-revisited-rehabilitating-java-with-the-aid-of-d/

I stared at

forest_t[] quickSort(forest_t[] fors) pure nothrow {
  if (fors.length >= 2) {
auto parts = partition3!(forLessThan)(fors, fors[$ / 2]);
parts[0].quickSort;
parts[2].quickSort;
  }
  return fors;
}

for a while. Could somebody explain why this gave such a speed 
boost? To my knowledge it is an optimization which gives extra 
speedup when fors is already partially sorted right?


Are there any plans to merge this optimization into existing or 
new sorting algorithms in Phobos?


I recall that Python's default sorting algorithm is related to 
this, right?


Re: Tuple and tie?

2014-07-08 Thread anonymous via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 19:40:59 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:

template TypesOf(T...)
{
static if (T.length == 1)
alias TypesOf = typeof(T[0]);
else
alias TypesOf = TypeTuple!(typeof(T[0]), 
TypesOf!(T[1..$]));
}

@property void tie(T...)(Tuple!(TypesOf!T) t)

[...]
It does involve some slightly more arcane template magic, 
though. ;-)
Basically, the TypesOf template transforms a list of alias 
arguments
into a list of the types of said arguments, so that we can 
match a list

of variables to the Tuple that is to be assigned to them.


typeof(T) would work, too.


Re: Tuple and tie?

2014-07-08 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 08, 2014 at 07:02:17PM +, NCrashed via Digitalmars-d-learn 
wrote:
[...]
> auto tie(StoreElements...)(ref StoreElements stores)
[...]

Here's my take on it, that doesn't need to use pointers:

import std.typecons;

template TypesOf(T...)
{
static if (T.length == 1)
alias TypesOf = typeof(T[0]);
else
alias TypesOf = TypeTuple!(typeof(T[0]), 
TypesOf!(T[1..$]));
}

@property void tie(T...)(Tuple!(TypesOf!T) t)
{
foreach (i, ref var; T)
{
T[i] = t[i];
}
}

Tuple!(int, string) func() {
return tuple(1, "a");
}

void main()
{
int x;
string y;

tie!(x,y) = func();

import std.stdio;
writefln("%d %s", x, y);
}

It does involve some slightly more arcane template magic, though. ;-)
Basically, the TypesOf template transforms a list of alias arguments
into a list of the types of said arguments, so that we can match a list
of variables to the Tuple that is to be assigned to them.

This also (ab)uses the fact that assigning to a function call gets
interpreted in this context as setting a global @property, so there's no
need to overload opAssign at all. (Arguably, this makes it more an
insane hack than a clever solution!)


T

-- 
Once the bikeshed is up for painting, the rainbow won't suffice. -- Andrei 
Alexandrescu


Re: Tuple and tie?

2014-07-08 Thread NCrashed via Digitalmars-d-learn

Sorry, some glitch with email answer.

The main difference between my solution and TypeTuple is that you 
can pass anonymous struct between other functions to use it later:

```
void foo(T)(T holder)
{
holder = sinCos(3.0f);
}

void main()
{
float s,c;
foo(tie(s,c));
writeln(s, " ", c);
}
```


Re: Tuple and tie?

2014-07-08 Thread NCrashed via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 17:42:00 UTC, Remo wrote:


How to make something that work like std::tie in D2 ?

Tuple!(float, float) sinCos(float n) {
  return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

int main(string[] argv) {
 float s,c;
 tie!(s,c) = sinCos(3.0f);
}


Try the following approach:
```
import std.typecons;
import std.typetuple;
import std.math;
import std.stdio;

auto tie(StoreElements...)(ref StoreElements stores)
{
alias Elements = staticMap!(Unqual, StoreElements);

template toPointer(T)
{
alias toPointer = T*;
}

struct Holder
{
alias StoreElementsPtrs = staticMap!(toPointer, StoreElements);
StoreElementsPtrs storePtrs;

this(ref StoreElements stores)
{
foreach(i, _; StoreElements)
{
storePtrs[i] = &stores[i];
}
}

void opAssign(Tuple!Elements values)
{
foreach(i, _; Elements)
{
*storePtrs[i] = values[i];
}
}
}

return Holder(stores);
}

Tuple!(float, float) sinCos(float n)
{
	return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

void main()
{
float s,c;
tie(s,c) = sinCos(3.0f);
writeln(s, " ", c);
}
```


Re: Tuple and tie?

2014-07-08 Thread NCrashed . via Digitalmars-d-learn
Try this:
```
import std.typecons;
import std.typetuple;
import std.math;
import std.stdio;

auto tie(StoreElements...)(ref StoreElements stores)
{
alias Elements = staticMap!(Unqual, StoreElements);
 template toPointer(T)
{
alias toPointer = T*;
}
 struct Holder
{
alias StoreElementsPtrs = staticMap!(toPointer, StoreElements);
StoreElementsPtrs storePtrs;
 this(ref StoreElements stores)
{
foreach(i, _; StoreElements)
{
storePtrs[i] = &stores[i];
}
}
 void opAssign(Tuple!Elements values)
{
foreach(i, _; Elements)
{
*storePtrs[i] = values[i];
}
}
}
 return Holder(stores);
}

Tuple!(float, float) sinCos(float n)
{
return tuple(cast(float)sin(n), cast(float)cos(n)); //please note
cast(float)!
}

void main()
{
float s,c;
tie(s,c) = sinCos(3.0f);
writeln(s, " ", c);
}
```


2014-07-08 22:55 GMT+04:00 Meta via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com>:

> On Tuesday, 8 July 2014 at 18:45:21 UTC, Remo wrote:
>
>> On Tuesday, 8 July 2014 at 18:29:40 UTC, Meta wrote:
>>
>>> On Tuesday, 8 July 2014 at 17:42:00 UTC, Remo wrote:
>>>

 How to make something that work like std::tie in D2 ?

 Tuple!(float, float) sinCos(float n) {
 return tuple(cast(float)sin(n), cast(float)cos(n)); //please note
 cast(float)!
 }

 int main(string[] argv) {
 float s,c;
 tie!(s,c) = sinCos(3.0f);
 }

>>>
>>> alias tie = TypeTuple;
>>>
>>> int main(string[] argv)
>>> {
>>>float s,c;
>>>tie!(s,c) = sinCos(3.0f);
>>> }
>>>
>>
>> Thanks !
>> This is easier as I was thinking :)
>> Now I only need to be sure that this do not have unwanted side effects.
>>
>
> It's fine. There's not much to TypeTuple; it's defined like this:
>
> alias TypeTuple(TList...) = alias TypeTuple = TList;
>
> Where TList is any number of... things. Types, variables, values, template
> names, etc. Therefore, `TypeTuple!(s, c)` at a low level it's more or less
> like the following:
>
> float s, c;
>
> s = sinCos(3.0f)[0];
> c = sinCos(3.0f)[1];
>
> Not that sinCos is called twice. It's only called once, and the result is
> distributed across s and c.
>


Re: Tuple and tie?

2014-07-08 Thread Meta via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 18:45:21 UTC, Remo wrote:

On Tuesday, 8 July 2014 at 18:29:40 UTC, Meta wrote:

On Tuesday, 8 July 2014 at 17:42:00 UTC, Remo wrote:


How to make something that work like std::tie in D2 ?

Tuple!(float, float) sinCos(float n) {
return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

int main(string[] argv) {
float s,c;
tie!(s,c) = sinCos(3.0f);
}


alias tie = TypeTuple;

int main(string[] argv)
{
   float s,c;
   tie!(s,c) = sinCos(3.0f);
}


Thanks !
This is easier as I was thinking :)
Now I only need to be sure that this do not have unwanted side 
effects.


It's fine. There's not much to TypeTuple; it's defined like this:

alias TypeTuple(TList...) = alias TypeTuple = TList;

Where TList is any number of... things. Types, variables, values, 
template names, etc. Therefore, `TypeTuple!(s, c)` at a low level 
it's more or less like the following:


float s, c;

s = sinCos(3.0f)[0];
c = sinCos(3.0f)[1];

Not that sinCos is called twice. It's only called once, and the 
result is distributed across s and c.


Re: array help.

2014-07-08 Thread NA via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 18:40:37 UTC, bearophile wrote:

NA:


will not work and no I can't sort it.


Why no sort?


Thanks,
It works as expected.

As for the sort - wasn't thinking straight.

Cheers,
NA



Re: Tuple and tie?

2014-07-08 Thread Remo via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 18:29:40 UTC, Meta wrote:

On Tuesday, 8 July 2014 at 17:42:00 UTC, Remo wrote:


How to make something that work like std::tie in D2 ?

Tuple!(float, float) sinCos(float n) {
 return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

int main(string[] argv) {
float s,c;
tie!(s,c) = sinCos(3.0f);
}


alias tie = TypeTuple;

int main(string[] argv)
{
float s,c;
tie!(s,c) = sinCos(3.0f);
}


Thanks !
This is easier as I was thinking :)
Now I only need to be sure that this do not have unwanted side 
effects.




Re: array help.

2014-07-08 Thread bearophile via Digitalmars-d-learn

NA:


will not work and no I can't sort it.


Why no sort?


void main() {
import std.algorithm: sort, SwapStrategy;
import std.array: empty;

int[][][][] a =
[[[],
  [],
  [],
  [],
  [[0, 1], [0, 2]],
  [[0, 0], [0, 3]]
 ],
 [[],
  [],
  [],
  [],
  [[1, 1], [1, 2]],
  [[1, 0], [1, 3]]
 ]
];

int[][][][] b =
0, 1], [0, 2]],
  [[0, 0], [0, 3]],
  [],
  [],
  [],
  []
 ],
 [[[1, 1], [1, 2]],
  [[1, 0], [1, 3]],
  [],
  [],
  [],
  []
 ]
];

foreach (s1; a)
s1.sort!(q{ a.empty < b.empty }, SwapStrategy.stable);
assert(a == b);
}


Bye,
bearophile


Re: array help.

2014-07-08 Thread Tobias Pankrath via Digitalmars-d-learn




will not work and no I can't sort it.

Cheers.


What are you trying to do? To reorder the elements of a sequence 
in a specified manner is called sorting, where I live.




Re: array help.

2014-07-08 Thread Tobias Pankrath via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 18:26:20 UTC, bearophile wrote:

Tobias Pankrath:


Use std.algorithm.sort with a custom comparison function.


It's a very nice example of learning algorithms and data 
fitting. I have shown an answer very fitted (perhaps 
over-fitted) on the given example.


I had your solution in mind, too, as a hint that the problem 
might be underspecified.


With just the given data there is no way to know how much 
general the problem is :-)


Yeah, but I hope at least he knows it.


Re: array help.

2014-07-08 Thread NA via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 18:16:55 UTC, bearophile wrote:

NA:


Any ideas welcome.


Is this good enough?

void main() {
import std.algorithm: swap;

int[][][][] a =
[[[],
  [],
  [[0, 1], [0, 2]],
  [[0, 0], [0, 3]]
 ],
 [[],
  [],
  [[1, 1], [1, 2]],
  [[1, 0], [1, 3]]
 ]
];

int[][][][] b =
0, 1], [0, 2]],
  [[0, 0], [0, 3]],
  [],
  [],
 ],
 [[[1, 1], [1, 2]],
  [[1, 0], [1, 3]],
  [],
  []
 ]
];

foreach (s1; a) {
swap(s1[0], s1[2]);
swap(s1[1], s1[3]);
}
assert(a == b);
}


Bye,
bearophile


Thanks but

int[][][][] a =
[[[],
  [],
  [],
  [],
  [[0, 1], [0, 2]],
  [[0, 0], [0, 3]]
 ],
 [[],
  [],
  [],
  [],
  [[1, 1], [1, 2]],
  [[1, 0], [1, 3]]
 ]
];

will not work and no I can't sort it.

Cheers.


Re: Tuple and tie?

2014-07-08 Thread Meta via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 17:42:00 UTC, Remo wrote:


How to make something that work like std::tie in D2 ?

Tuple!(float, float) sinCos(float n) {
  return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

int main(string[] argv) {
 float s,c;
 tie!(s,c) = sinCos(3.0f);
}


alias tie = TypeTuple;

int main(string[] argv)
{
float s,c;
tie!(s,c) = sinCos(3.0f);
}


Re: array help.

2014-07-08 Thread bearophile via Digitalmars-d-learn

Tobias Pankrath:


Use std.algorithm.sort with a custom comparison function.


It's a very nice example of learning algorithms and data fitting. 
I have shown an answer very fitted (perhaps over-fitted) on the 
given example. With just the given data there is no way to know 
how much general the problem is :-)


Bye,
bearophile


Re: array help.

2014-07-08 Thread bearophile via Digitalmars-d-learn

NA:


Any ideas welcome.


Is this good enough?

void main() {
import std.algorithm: swap;

int[][][][] a =
[[[],
  [],
  [[0, 1], [0, 2]],
  [[0, 0], [0, 3]]
 ],
 [[],
  [],
  [[1, 1], [1, 2]],
  [[1, 0], [1, 3]]
 ]
];

int[][][][] b =
0, 1], [0, 2]],
  [[0, 0], [0, 3]],
  [],
  [],
 ],
 [[[1, 1], [1, 2]],
  [[1, 0], [1, 3]],
  [],
  []
 ]
];

foreach (s1; a) {
swap(s1[0], s1[2]);
swap(s1[1], s1[3]);
}
assert(a == b);
}


Bye,
bearophile


Re: array help.

2014-07-08 Thread Tobias Pankrath via Digitalmars-d-learn



Any ideas welcome.

NA


Use std.algorithm.sort with a custom comparison function.


array help.

2014-07-08 Thread NA via Digitalmars-d-learn

Hi,

I have the following array.

[
[
[],
[],
[[0, 1] [0, 2]],
[[0, 0] [0, 3]]
]

[
[],
[],
[[1, 1] [1, 2]],
[[1, 0] [1, 3]]
]
]

and would like it to be arranged like

[
[
[[0, 1] [0, 2]],
[[0, 0] [0, 3]],
[],
[]
]

[
[[1, 1] [1, 2]],
[[1, 0] [1, 3]],
[],
[]
]
]

Any ideas welcome.

NA


Tuple and tie?

2014-07-08 Thread Remo via Digitalmars-d-learn


How to make something that work like std::tie in D2 ?

Tuple!(float, float) sinCos(float n) {
  return tuple(cast(float)sin(n), cast(float)cos(n)); //please 
note cast(float)!

}

int main(string[] argv) {
 float s,c;
 tie!(s,c) = sinCos(3.0f);
}


Re: Capture offset of matches in std.regex.matchAll?

2014-07-08 Thread JD via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 15:58:47 UTC, Justin Whear wrote:


What do you mean by offset?  If you simply mean the index of 
the match,
as your example seems to indicate, you can zip the matches with 
iota or

sequence!"n".

If you want the offset in the string where each match begins I 
think
you're out of luck.  I needed something similar a while ago and 
the best
I could find was using the cumulative length of the pre 
property.



Sorry for my confusing example!

Yes, I was looking for the offset in the string where the matches 
begin.
I did some programming in PHP in the past. Their preg_match_all 
function has an optional offset_capture flag. I was hoping for 
something similar in std.regex...


Good tip, I'll use the cumulative length of pre.

Thanks you both for your replies!





Re: Capture offset of matches in std.regex.matchAll?

2014-07-08 Thread Justin Whear via Digitalmars-d-learn
On Mon, 07 Jul 2014 21:32:29 +, JD wrote:

> I'm using a compile time regex to find some tags in an input string. Is
> it possible to capture the offset of the matches in some way? Otherwise
> I have to "calculate" the offsets myself by iterating over the results
> of matchAll.
> 
> Thanks,
> Jeroen
> 
> ---
> 
> Example code:
> 
> import std.stdio;
> import std.regex;
> 
> void main()
> {
>   auto input = "{{ message }}";
>   
>   auto ctr = ctRegex!(`(\{\{|\{\%|\{\#)?`, "s");
> 
>   auto matches = matchAll(input, ctr);
> 
>/*
>   auto offset = 0;
>   foreach(match;matches)
>   {
>   writeln(offset, ":", match);
>   ++offset;
>   }
>   */
> }

What do you mean by offset?  If you simply mean the index of the match, 
as your example seems to indicate, you can zip the matches with iota or 
sequence!"n".

If you want the offset in the string where each match begins I think 
you're out of luck.  I needed something similar a while ago and the best 
I could find was using the cumulative length of the pre property.


Re: [dmd 2.066-b1] std.range.array with shared objects and AA rehash

2014-07-08 Thread NCrashed via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 13:07:57 UTC, Meta wrote:

On Tuesday, 8 July 2014 at 12:42:44 UTC, NCrashed wrote:
Oops, I forgot shared at new. But the major issue is that 
doesn't fix the problem:

```
import std.range;

class A {}

InputRange!(shared A) foo()
{
return [new shared A].inputRangeObject;
}

void bar()
{
auto res = foo.array;
}

void main() {}
```
Output:
```
/usr/include/dmd/phobos/std/conv.d(3914): Error: cannot 
implicitly convert expression (arg) of type shared(A) to app.A
/usr/include/dmd/phobos/std/array.d(2476): Error: template 
instance 
std.conv.emplaceRef!(shared(A)).emplaceRef!(shared(A)) error 
instantiating
/usr/include/dmd/phobos/std/array.d(64):instantiated 
from here: put!(shared(A))
source/app.d(12):instantiated from here: 
array!(InputRange!(shared(A)))

```


Hmmm, it worked when I compiled it on Dpaste, so you must be 
using a different compiler. There were some changes to shared 
in the current 2.066 beta, so that may be the cause. Somebody 
more experienced with shared than me will have to answer.


I appreciate you help, the error smells like a bug. That compiles 
on dmd 2.065, but I am testing new dmd 2.066-b1 to not suddenly 
get dozens of such errors when it becomes a release.


Re: Capture offset of matches in std.regex.matchAll?

2014-07-08 Thread JR via Digitalmars-d-learn

On Monday, 7 July 2014 at 21:32:30 UTC, JD wrote:

I'm using a compile time regex to find some tags in an input
string. Is it possible to capture the offset of the matches in
some way? Otherwise I have to "calculate" the offsets myself by
iterating over the results of matchAll.

Thanks,
Jeroen


I believe what matchAll returns evaluates its .front lazily, so 
aye; you need to pop it until you get to the match you want. :< 
(assuming I understand the question correctly)


You can however index the *captured fields* in a specific match. 
I couldn't wrap my head around your example pattern but see 
http://dpaste.dzfl.pl/f693db93c3a4 for a dumbed-down version.


You can't slice match, nor can you have foreach provide an index 
variable. This may be to have foreach include named fields? Not 
sure.


Re: Incomplete types question

2014-07-08 Thread Ali Çehreli via Digitalmars-d-learn

On 07/08/2014 03:35 AM, bearophile wrote:

> Ali Çehreli:
>
>> 1) Put the opaque type and its functions into a .di file:
>
> [...]
>
> It seems your answer has scared NoUseForAName off. Next times we need to
> be more careful, and suggest a D-idiomatic solution instead.
>
> Bye,
> bearophile

I should have first asked what the need was.

Ali



Re: [dmd 2.066-b1] DList. Cannot remove from an un-initialized List

2014-07-08 Thread NCrashed via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 13:06:34 UTC, NCrashed wrote:

This was working under 2.065:
```
import std.container;

void main()
{
DList!int list;
list.clear();
}
```

Run-time assertion:
```
core.exception.AssertError@/usr/include/dmd/phobos/std/container/dlist.d(480): 
Cannot remove from an un-initialized List


/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
std.container.dlist.DList!(int).DList.Range 
std.container.dlist.DList!(int).DList.remove(std.container.dlist.DList!(int).DList.Range)+0x90) 
[0x441830]
/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
void std.container.dlist.DList!(int).DList.clear()+0x65) 
[0x4410dd]

/home/ncrashed/dev/d/dmd-test/dmd-test(_Dmain+0x1a) [0x43df3a]
/home/ncrashed/dev/d/dmd-test/dmd-test(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x28) 
[0x44aeac]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44adf1]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll()+0x2d) [0x44ae51]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44adf1]
/home/ncrashed/dev/d/dmd-test/dmd-test(_d_run_main+0x192) 
[0x44ad66]

/home/ncrashed/dev/d/dmd-test/dmd-test(main+0x25) [0x448355]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x39e9021d65]

```

Does DList requires any explicit initialization now or it is a 
regression?


And some addition:
```
import std.container;

void main()
{
DList!int list;
list.insert = 42;
list.clear(); list.clear();
}
```

Output:
```
core.exception.AssertError@/usr/include/dmd/phobos/std/container/dlist.d(481): 
Remove: Range is empty


/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
std.container.dlist.DList!(int).DList.Range 
std.container.dlist.DList!(int).DList.remove(std.container.dlist.DList!(int).DList.Range)+0xcc) 
[0x4419b4]
/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
void std.container.dlist.DList!(int).DList.clear()+0x65) 
[0x441225]

/home/ncrashed/dev/d/dmd-test/dmd-test(_Dmain+0x31) [0x43e081]
/home/ncrashed/dev/d/dmd-test/dmd-test(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x28) 
[0x44b0cc]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44b011]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll()+0x2d) [0x44b071]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44b011]
/home/ncrashed/dev/d/dmd-test/dmd-test(_d_run_main+0x192) 
[0x44af86]

/home/ncrashed/dev/d/dmd-test/dmd-test(main+0x25) [0x448575]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x39e9021d65]
```


Re: Class in Class

2014-07-08 Thread bearophile via Digitalmars-d-learn

seany:

Iwonder if you could as well define a class inside another 
class. I dont know if it is theoritically at all a sensible 
thing to do. Just asking the question.


You can nest them. But in some cases you also want to use the 
"static" keyword.


Bye,
bearophile


[dmd 2.066-b1] DList. Cannot remove from an un-initialized List

2014-07-08 Thread NCrashed via Digitalmars-d-learn

This was working under 2.065:
```
import std.container;

void main()
{
DList!int list;
list.clear();
}
```

Run-time assertion:
```
core.exception.AssertError@/usr/include/dmd/phobos/std/container/dlist.d(480): 
Cannot remove from an un-initialized List


/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
std.container.dlist.DList!(int).DList.Range 
std.container.dlist.DList!(int).DList.remove(std.container.dlist.DList!(int).DList.Range)+0x90) 
[0x441830]
/home/ncrashed/dev/d/dmd-test/dmd-test(pure nothrow @nogc @safe 
void std.container.dlist.DList!(int).DList.clear()+0x65) 
[0x4410dd]

/home/ncrashed/dev/d/dmd-test/dmd-test(_Dmain+0x1a) [0x43df3a]
/home/ncrashed/dev/d/dmd-test/dmd-test(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x28) 
[0x44aeac]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44adf1]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll()+0x2d) [0x44ae51]
/home/ncrashed/dev/d/dmd-test/dmd-test(void 
rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate())+0x2d) 
[0x44adf1]
/home/ncrashed/dev/d/dmd-test/dmd-test(_d_run_main+0x192) 
[0x44ad66]

/home/ncrashed/dev/d/dmd-test/dmd-test(main+0x25) [0x448355]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x39e9021d65]

```

Does DList requires any explicit initialization now or it is a 
regression?


Re: [dmd 2.066-b1] std.range.array with shared objects and AA rehash

2014-07-08 Thread Meta via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 12:42:44 UTC, NCrashed wrote:
Oops, I forgot shared at new. But the major issue is that 
doesn't fix the problem:

```
import std.range;

class A {}

InputRange!(shared A) foo()
{
return [new shared A].inputRangeObject;
}

void bar()
{
auto res = foo.array;
}

void main() {}
```
Output:
```
/usr/include/dmd/phobos/std/conv.d(3914): Error: cannot 
implicitly convert expression (arg) of type shared(A) to app.A
/usr/include/dmd/phobos/std/array.d(2476): Error: template 
instance std.conv.emplaceRef!(shared(A)).emplaceRef!(shared(A)) 
error instantiating
/usr/include/dmd/phobos/std/array.d(64):instantiated 
from here: put!(shared(A))
source/app.d(12):instantiated from here: 
array!(InputRange!(shared(A)))

```


Hmmm, it worked when I compiled it on Dpaste, so you must be 
using a different compiler. There were some changes to shared in 
the current 2.066 beta, so that may be the cause. Somebody more 
experienced with shared than me will have to answer.


Re: [dmd 2.066-b1] std.range.array with shared objects and AA rehash

2014-07-08 Thread NCrashed via Digitalmars-d-learn

On Monday, 7 July 2014 at 15:34:33 UTC, Meta wrote:

On Monday, 7 July 2014 at 09:53:22 UTC, NCrashed wrote:
I am using ranges (wrapped in InputRangeObject for use in 
interfaces) of shared objects, with new beta some cases are 
broken:

```
import std.range;

class A {}

InputRange!(shared A) foo()
{
return [new A].inputRangeObject;
}

void bar()
{
auto res = foo.array;
}

void main() {}
```
Fails with:
```
source/app.d(7): Error: cannot implicitly convert expression 
(inputRangeObject([new A])) of type 
std.range.InputRangeObject!(A[]).InputRangeObject to 
std.range.InputRange!(shared(A)).InputRange
/usr/include/dmd/phobos/std/conv.d(3914): Error: cannot 
implicitly convert expression (arg) of type shared(A) to app.A
/usr/include/dmd/phobos/std/array.d(2476): Error: template 
instance 
std.conv.emplaceRef!(shared(A)).emplaceRef!(shared(A)) error 
instantiating
/usr/include/dmd/phobos/std/array.d(64):instantiated 
from here: put!(shared(A))
source/app.d(12):instantiated from here: 
array!(InputRange!(shared(A)))

```

And also AA starts behave strange in shared context:
```
shared string[][string] map;

void main()
{
map.rehash;
}
```
My AA is stored in shared class, the shared is inferred 
implicitly. Also following workaround works:

```
void main()
{
(cast(shared(string[])[string])map).rehash;
}
```

Is this behavior a bug, or it works as expected?


I don't know about your second problem, but the fix for your 
first problem is to construct a shared A. You're trying to 
create a normal A and have it implicitly casted to shared, 
which the compiler won't do.


InputRange!(shared A) foo()
{
//"new shared A" instead of "new A"
return [new shared A].inputRangeObject;
}


Oops, I forgot shared at new. But the major issue is that doesn't 
fix the problem:

```
import std.range;

class A {}

InputRange!(shared A) foo()
{
return [new shared A].inputRangeObject;
}

void bar()
{
auto res = foo.array;
}

void main() {}
```
Output:
```
/usr/include/dmd/phobos/std/conv.d(3914): Error: cannot 
implicitly convert expression (arg) of type shared(A) to app.A
/usr/include/dmd/phobos/std/array.d(2476): Error: template 
instance std.conv.emplaceRef!(shared(A)).emplaceRef!(shared(A)) 
error instantiating
/usr/include/dmd/phobos/std/array.d(64):instantiated from 
here: put!(shared(A))
source/app.d(12):instantiated from here: 
array!(InputRange!(shared(A)))

```


Re: Incomplete types question

2014-07-08 Thread NoUseForAName via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 12:04:40 UTC, Marc Schütz wrote:
Addendum: You also need to protect the members of MyStructImpl, 
like so:


private struct MyStructImpl {
private:  // or `package:`
int x;
}

Otherwise, they would still be accessible via dereferencing.


Thanks again.


Class in Class

2014-07-08 Thread seany via Digitalmars-d-learn

You can define structs like this :

Struct A {

int A_int;

struct B {
...
}

}

Iwonder if you could as well define a class inside another class. 
I dont know if it is theoritically at all a sensible thing to do. 
Just asking the question.


Re: Incomplete types question

2014-07-08 Thread via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 11:55:01 UTC, bearophile wrote:

NoUseForAName:


Thanks, that is what I was looking for.


Why do you need a public pointer type but private struct type?


As the OP wrote:
In C my favorite way of achieving encapsulation is to use 
incomplete types.


(Also known as PIMPL.)

In C, it's the only type-safe way to get encapsulation, AFAIK. In 
languages with access protection, it's probably not as useful, 
but I'm sure it has its applications...


Re: Incomplete types question

2014-07-08 Thread via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 11:42:54 UTC, NoUseForAName wrote:

On Tuesday, 8 July 2014 at 11:16:52 UTC, Marc Schütz wrote:
Your example above doesn't work, because it would be 
interpreted as a redefinition of the struct. Instead, you can 
use a public alias to a private type:


// my_module.d:

private struct MyStructImpl {
   int x;
}

public alias MyStructPtr = MyStructImpl*;

void doSomething(MyStructPtr foo) {
   ...
}

// my_main_program.d:

MyStructPtr bar;// OK
MyStructImpl foo;   // Error: my_module.MyStructImpl is private


Thanks, that is what I was looking for.


Addendum: You also need to protect the members of MyStructImpl, 
like so:


private struct MyStructImpl {
private:  // or `package:`
int x;
}

Otherwise, they would still be accessible via dereferencing. 
(Don't worry, you _can_ access private members inside the module 
the struct is declared in, as access protection in D only applies 
across module boundaries.)


Re: Incomplete types question

2014-07-08 Thread bearophile via Digitalmars-d-learn

NoUseForAName:


Thanks, that is what I was looking for.


Why do you need a public pointer type but private struct type?

Bye,
bearophile


Re: Incomplete types question

2014-07-08 Thread NoUseForAName via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 11:16:52 UTC, Marc Schütz wrote:
Your example above doesn't work, because it would be 
interpreted as a redefinition of the struct. Instead, you can 
use a public alias to a private type:


// my_module.d:

private struct MyStructImpl {
int x;
}

public alias MyStructPtr = MyStructImpl*;

void doSomething(MyStructPtr foo) {
...
}

// my_main_program.d:

MyStructPtr bar;// OK
MyStructImpl foo;   // Error: my_module.MyStructImpl is private


Thanks, that is what I was looking for.


Re: Incomplete types question

2014-07-08 Thread bearophile via Digitalmars-d-learn

Marc Schütz:


Instead, you can use a public alias to a private type:

// my_module.d:

private struct MyStructImpl {
int x;
}

public alias MyStructPtr = MyStructImpl*;

void doSomething(MyStructPtr foo) {
...
}

// my_main_program.d:

MyStructPtr bar;// OK
MyStructImpl foo;   // Error: my_module.MyStructImpl is private


I still don't understand the point of doing this. Is @disable 
this usable here?


Bye,
bearophile


Re: Incomplete types question

2014-07-08 Thread via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 10:47:26 UTC, NoUseForAName wrote:
Also side question. What are these .di files? D propaganda 
radio told me that D does not need header files because it has 
a real module system (like e.g. Pascal or Go) yet in the 
solution Ali posted these .di files seem to be.. pretty much 
like C header files.


They are optional, for those situations when you don't want to 
distribute the entire source code (e.g. proprietary library 
distributed in binary form). They are usually auto-generated by 
the compiler (dmd -H), and I agree that it's awkward to have to 
define them manually.



So I could just put..

public struct S;

private struct S
{
int i;
}

.. in the .d file and that would work? I mean I expected 
something like this but then why would Ali post such a complex 
solution?


I guess because it's a (the only?) way to get real incomplete 
types. It is the most "literal" translation of what you 
described. But of course, there are better ways to achieve what 
you actually want.


Your example above doesn't work, because it would be interpreted 
as a redefinition of the struct. Instead, you can use a public 
alias to a private type:


// my_module.d:

private struct MyStructImpl {
int x;
}

public alias MyStructPtr = MyStructImpl*;

void doSomething(MyStructPtr foo) {
...
}

// my_main_program.d:

MyStructPtr bar;// OK
MyStructImpl foo;   // Error: my_module.MyStructImpl is private


Re: Incomplete types question

2014-07-08 Thread NoUseForAName via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 09:08:30 UTC, bearophile wrote:

NoUseForAName:

Thanks.. but this is awkward. I expected there to be keywords 
to declare type declarations public or private.


The keywords are "public" and "private".


So I could just put..

public struct S;

private struct S
{
int i;
}

.. in the .d file and that would work? I mean I expected 
something like this but then why would Ali post such a complex 
solution?


Also side question. What are these .di files? D propaganda radio 
told me that D does not need header files because it has a real 
module system (like e.g. Pascal or Go) yet in the solution Ali 
posted these .di files seem to be.. pretty much like C header 
files.


Re: Incomplete types question

2014-07-08 Thread bearophile via Digitalmars-d-learn

Ali Çehreli:


1) Put the opaque type and its functions into a .di file:


[...]

It seems your answer has scared NoUseForAName off. Next times we 
need to be more careful, and suggest a D-idiomatic solution 
instead.


Bye,
bearophile


Re: Sparse Aggregate Assignment/Initialization (RAII)

2014-07-08 Thread via Digitalmars-d-learn

On Monday, 7 July 2014 at 21:49:22 UTC, Justin Whear wrote:

On Mon, 07 Jul 2014 21:34:05 +, Nordlöw wrote:


However using this function through UFCS

 auto cx = new C().set!"x"(11);

fails as

algorithm_ex.d(1257,17): Error: template algorithm_ex.set 
cannot deduce

function from argument types !("x")(C, int), candidates are:
algorithm_ex.d(1242,7):algorithm_ex.set(string member, 
T,

U)(ref T a, in U value) if (isAggregateType!T && hasMember!(T,
member))

Instead I have to use

 auto c = new C(); set!"x"(c, 11);

which is not as elegant.

Why doesn't UCFS work here and is there a solution using DMD 
git master?


You need to use `auto ref` to have this work with both classes 
and
structs.  A working version of your code here: auto dx = 
D().set!"x"(11);

assert(dx.x == 11);


To elaborate:
`new C()` is an r-value, and references can only be taken from 
l-values.


Re: std.algorithm.sort error with default predicate

2014-07-08 Thread bearophile via Digitalmars-d-learn

H. S. Teoh:


This looks pretty serious. Please file a bug:

http://issues.dlang.org/


I have filed it myself, as "major":
https://issues.dlang.org/show_bug.cgi?id=13073

Bye,
bearophile


Re: Incomplete types question

2014-07-08 Thread bearophile via Digitalmars-d-learn

NoUseForAName:

Thanks.. but this is awkward. I expected there to be keywords 
to declare type declarations public or private.


The keywords are "public" and "private".



I guess I am going to stick with C for this.


I suggest you to not give up yet. About 100% of the times there 
are equivalent or better ways to do something of C in D.


Bye,
bearophile


Re: stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn
Ah nice. That worked. Thanks!



2014-07-08 9:25 GMT+02:00 JR via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com>:

> On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote:
>
>> Hi,
>>
>> I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d
>>
>> My program throws a custom exception with a custom error message at some
>> point. The stack trace (below) is very uninformative. Is there a way to
>> output the function names of each position in the stack?
>>
>> I already compile using -g and I also tried -gc and -gs and all three of
>> them together. I also tried -debug. The stack trace looks always like this:
>>
>> popGenFunc.IllegalParametersException@popGenFunc.d(556): gamma out of
>> range
>> 
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
>> /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
>> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ffe8440e76d]
>>
>> Thanks for your help,
>> Stephan
>>
>
> Tried building with -L--export-dynamic?
>


Re: Incomplete types question

2014-07-08 Thread NoUseForAName via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 06:28:51 UTC, Ali Çehreli wrote:

On 07/07/2014 09:44 PM, NoUseForAName wrote:

[snip]

[snip]
3) Compile the implementation as a library (just a .o in this 
case):


Thanks.. but this is awkward. I expected there to be keywords to 
declare type declarations public or private. Also using a 
separate .di file means I lose the whole advantage of not having 
to use header files. My idea here was basically to use D as a 
"better C", you know without the annoying stuff like header files 
/ no real modules. Seems C is actually superior for what I want 
to do. .di vs. h is no real advantage, and in C I do not need to 
move the implementation into a library to stop other modules from 
using the type directly.


Again, thanks for the detailed explanation but I guess I am going 
to stick with C for this.


Re: stack trace output on exception

2014-07-08 Thread JR via Digitalmars-d-learn

On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote:

Hi,

I am using dmd with version: DMD64 D Compiler 
v2.065-devel-db2a73d


My program throws a custom exception with a custom error 
message at some point. The stack trace (below) is very 
uninformative. Is there a way to output the function names of 
each position in the stack?


I already compile using -g and I also tried -gc and -gs and all 
three of them together. I also tried -debug. The stack trace 
looks always like this:


popGenFunc.IllegalParametersException@popGenFunc.d(556): gamma 
out of range


/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) 
[0x7ffe8440e76d]


Thanks for your help,
Stephan


Tried building with -L--export-dynamic?


stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn

Hi,

I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d

My program throws a custom exception with a custom error message 
at some point. The stack trace (below) is very uninformative. Is 
there a way to output the function names of each position in the 
stack?


I already compile using -g and I also tried -gc and -gs and all 
three of them together. I also tried -debug. The stack trace 
looks always like this:


popGenFunc.IllegalParametersException@popGenFunc.d(556): gamma 
out of range


/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) 
[0x7ffe8440e76d]


Thanks for your help,
Stephan