Re: Functional Sort

2014-11-15 Thread Meta via Digitalmars-d-learn
On Saturday, 15 November 2014 at 03:47:25 UTC, Steven Schveighoffer wrote: err... this isn't what you want. That will sort the range, and then make a copy of the sorted range as an array. Yes, I didn't see the the second constraint to not sort the original range. Sort before .array -

Re: How to use Linux message queues?

2014-11-15 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote: On Friday, 14 November 2014 at 16:45:45 UTC, Sean Kelly wrote: Sounds like a module that should be in core.sys.linux. Care to submit a pull request? Ok, I've tried to make a module, though since I'm a D beginner (also a student who

Re: How to use Linux message queues?

2014-11-15 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote: Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes) Incidentally, where are you studying? It would be nice to know where D is being taught.

Re: Functional Sort

2014-11-15 Thread Nordlöw
On Saturday, 15 November 2014 at 03:47:25 UTC, Steven Schveighoffer wrote: Note, there isn't any generic way to say give me a copy of this range, as the same type. array is probably the best you will get. Just make sure you call it *before* you sort, unless you want both ranges sorted :)

dfl2 GUI Builder

2014-11-15 Thread Suliman via Digitalmars-d-learn
I have got few questions about DFL2. 1: What is dco and in which situation I should prefer it's to dub? 2: Old DFL had easy to use GUI Builder. Does dfl2 have such tool?

Re: Functional Sort

2014-11-15 Thread Nordlöw
On Saturday, 15 November 2014 at 08:52:45 UTC, Meta wrote: On Saturday, 15 November 2014 at 03:47:25 UTC, Steven Schveighoffer wrote: err... this isn't what you want. That will sort the range, and then make a copy of the sorted range as an array. Yes, I didn't see the the second constraint to

Multi-Prefix Version of skipOver()

2014-11-15 Thread Nordlöw
What's currently the fastest way of removing the largest matching prefix from an array of prefix arrays from an array in D like auto x = first_second; x.skipOverLargestMatch([fir, first]); assert( == _second); auto x = first_second; x.skipOverLargestMatch([fir]);

Re: Multi-Prefix Version of skipOver()

2014-11-15 Thread Nordlöw
On Saturday, 15 November 2014 at 14:41:29 UTC, Nordlöw wrote: What's currently the fastest way of removing the largest matching prefix from an array of prefix arrays from an array in D like auto x = first_second; x.skipOverLargestMatch([fir, first]); assert( == _second); auto

Re: Functional Sort

2014-11-15 Thread Nordlöw
On Saturday, 15 November 2014 at 14:34:07 UTC, Nordlöw wrote: What's wrong with my isArray-overload of sorted? I solved it by replacing R s = r.dup; with auto s = r.dup; As a follow up I know wonder if it is ok for isArray-overload of sorted() to have return type ubyte[] if input

Recursive template

2014-11-15 Thread Eric via Digitalmars-d-learn
Hi - I've never designed a recursive template before, but I think that would solve my problem. What I would like is someting like this: class X(V, K...) { // I want to declare a type based on K and V such // that for X!(V, int, string, double) the resulting // declaration would be:

Re: Recursive template

2014-11-15 Thread anonymous via Digitalmars-d-learn
On Saturday, 15 November 2014 at 18:30:00 UTC, Eric wrote: Hi - I've never designed a recursive template before, but I think that would solve my problem. What I would like is someting like this: class X(V, K...) { // I want to declare a type based on K and V such // that for X!(V,

Re: Recursive template

2014-11-15 Thread Eric via Digitalmars-d-learn
Thanks! -Eric On Saturday, 15 November 2014 at 18:49:32 UTC, anonymous wrote: On Saturday, 15 November 2014 at 18:30:00 UTC, Eric wrote: Hi - I've never designed a recursive template before, but I think that would solve my problem. What I would like is someting like this: class X(V,

Mixed Language Programming - e**x crashes

2014-11-15 Thread R**3 via Digitalmars-d-learn
Programming old-timer (but D newbie) with an interesting problem. Have been doing some playing around with D (DMD v2.066.0) calling FORTRAN. Asked at the SilverFrost FTN95 Support Forum, kicked some ideas around, no differences. I realize that a definitive answer will be difficult since I

Howto use an alternative Linker with DUB?

2014-11-15 Thread univacc via Digitalmars-d-learn
Hi, I am sitting in front of this problems for hours now and I need help: I need the a linker that is capable of delayed DLL loading and apparently, OPTLINK does not provide this option. unilink and Microsofts incremental linker support it so I would like to use one of them but I cannot

Calling to!string with null std.typecons.Rebindable results in segfault

2014-11-15 Thread ZombineDev via Digitalmars-d-learn
Hi guys! I'm implementing a mixin for sinking the values of all class members which can be used like this: class MyFancyClassWithAlotOfMembers { // Many members here... void toString(scope void delegate(const(char)[]) sink) const { import utils.prettyPrint;

Re: How to use Linux message queues?

2014-11-15 Thread Neven via Digitalmars-d-learn
On Saturday, 15 November 2014 at 12:04:45 UTC, Gary Willoughby wrote: On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote: Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes) Incidentally, where are you

How do I disable implicit struct constructor calls (and is that a good idea)?

2014-11-15 Thread Max Marrone via Digitalmars-d-learn
I was surprised to find that single-parameter struct constructors can be called implicitly: struct Foo { string s; this(string s) { this.s = s; } } void main() { Foo foo = bar; // Here. assert(foo.s == bar); } I don't believe this syntax makes sense for my

Re: Recursive template

2014-11-15 Thread Chris Nicholson-Sauls via Digitalmars-d-learn
Slightly simpler: struct SomeType(K, V) {} alias X(V) = V; alias X(V, K...) = SomeType!(K[0], X!(V, K[1 .. $])); That's a recurring pattern to get used to: aliasing away to one of the parameters in a terminal and/or degenerate case. Also: that an empty tuple matches no parameter