Re: strange compilation error

2014-03-10 Thread Kenji Hara
On Sunday, 9 March 2014 at 11:21:19 UTC, Jack Applegame wrote: This fails to compile http://dpaste.dzfl.pl/e9a90e808af4 It's a compiler bug. https://d.puremagic.com/issues/show_bug.cgi?id=12334 https://github.com/D-Programming-Language/dmd/pull/3371 Kenji Hara

Re: Linux Dynamic Loading of shared libraries

2014-03-10 Thread Steve Teale
On Sunday, 9 March 2014 at 14:09:28 UTC, Tolga Cakiroglu wrote: For this, you create an Interface that matches to the method declaration of your class. But notice that instead of defining methods, you will define attributes those types' match to that class's methods. I did this before and

Re: Linux Dynamic Loading of shared libraries

2014-03-10 Thread Anthony Goins
On Monday, 10 March 2014 at 06:38:35 UTC, Steve Teale wrote: On Sunday, 9 March 2014 at 14:09:28 UTC, Tolga Cakiroglu wrote: For this, you create an Interface that matches to the method declaration of your class. But notice that instead of defining methods, you will define attributes those

Re: Linux Dynamic Loading of shared libraries

2014-03-10 Thread Steve Teale
On Sunday, 9 March 2014 at 12:07:22 UTC, Steve Teale wrote: Now suppose that my D shared library contains a class, rather that just module ctors/dtors, how do I go about creating an instance of that class and using its methods? After wandering down several dead-end paths, and help from other

Re: linear search using 'find' on an array of structs?

2014-03-10 Thread captain_fid
On Sunday, 9 March 2014 at 10:46:26 UTC, Philippe Sigaud wrote: assert(!find!(toLower(a) == b)(s, hello).empty); assert(!find!(toLower(a) == b)(clist.name, name2).empty); But clist is an array of c's, it has no `.name` field by itself. So, put the `.name` call inside the

linking against libmilter

2014-03-10 Thread Hugo Florentino
Hi, Does anyone have an example of linking against libmilter? The milter applications I have seen are a little overweight for my taste, I just want to check email headers. I sure would like to take advante of the fast regexp of D rather than buildin my own solution in C (which I don't

Any way to print compile-time generated code?

2014-03-10 Thread Chris Williams
I'm toying with the dproto library and have encountered an issue where I can't remove items from a repeated list of items. I'd like to see what the mixins are producing in terms of actual D code, so that I can figure out how I can correctly try to delete an entry or find the code that's

Re: Any way to print compile-time generated code?

2014-03-10 Thread Adam D. Ruppe
Change the mixin(x) line to pragma(msg, x);. It will then print out the generated string at compile time instead of mixing it in so you can take a look at it.

Re: Any way to print compile-time generated code?

2014-03-10 Thread Chris Williams
On Monday, 10 March 2014 at 18:25:10 UTC, Adam D. Ruppe wrote: Change the mixin(x) line to pragma(msg, x);. It will then print out the generated string at compile time instead of mixing it in so you can take a look at it. That just gives me an error: source/app.d(29): Error: Cannot interpret

Explicit Declaration of Pureness and Throwness of Higher Order Ranges

2014-03-10 Thread Nordlöw
Is it, in D today, possible to explicitly tag higher order ranges such as for example `map` with their pureness, safeness and throwness based on the corresponding properties on their function arguments such as `fun...`? And is this motivated? now that the D compiler deduce these properties

Re: Explicit Declaration of Pureness and Throwness of Higher Order Ranges

2014-03-10 Thread Jonathan M Davis
On Monday, March 10, 2014 22:02:39 Nordlöw wrote: Is it, in D today, possible to explicitly tag higher order ranges such as for example `map` with their pureness, safeness and throwness based on the corresponding properties on their function arguments such as `fun...`? And is this

Re: Explicit Declaration of Pureness and Throwness of Higher Order Ranges

2014-03-10 Thread Nordlöw
I'm not quite sure what you're asking. You either mark a function as @safe, pure, and/or nothrow - or you don't, in which case, if it's a templated function, the attributes are inferred to the best of the compiler's capabilities, and if it's not, then the function doesn't have those

ambiguous definition

2014-03-10 Thread Pasqui23
Hi. I was editing std.string,but when I tried to compile it it game me this error: string.d(368): Error: template std.string.indexOf cannot deduce function from argument types !()(string, dchar), candidates are: string.d(306):std.string.indexOf(S)(S s, ElementType!S c, CaseSensitive cs =

writeln if not empty

2014-03-10 Thread Timothee Cour
Is there a way to do the following lazily: writelnIfNotEmpty(T)(T a){ auto b=text(a); if(b.length) writeln(b); } ie, without using std.conv.text (which needlessly computes an intermediate string, which could be quite large) or launching a separate process ? writelnIfNotEmpty(); //doesn't

Re: writeln if not empty

2014-03-10 Thread Nick Sabalausky
On 3/10/2014 9:24 PM, Timothee Cour wrote: Is there a way to do the following lazily: writelnIfNotEmpty(T)(T a){ auto b=text(a); if(b.length) writeln(b); } ie, without using std.conv.text (which needlessly computes an intermediate string, which could be quite large) or launching a separate

Re: writeln if not empty

2014-03-10 Thread Jonathan M Davis
On Monday, March 10, 2014 21:50:25 Nick Sabalausky wrote: On 3/10/2014 9:24 PM, Timothee Cour wrote: Is there a way to do the following lazily: writelnIfNotEmpty(T)(T a){ auto b=text(a); if(b.length) writeln(b); } ie, without using std.conv.text (which needlessly

Re: writeln if not empty

2014-03-10 Thread Timothee Cour
On Mon, Mar 10, 2014 at 9:14 PM, Jonathan M Davis jmdavisp...@gmx.comwrote: On Monday, March 10, 2014 21:50:25 Nick Sabalausky wrote: On 3/10/2014 9:24 PM, Timothee Cour wrote: Is there a way to do the following lazily: writelnIfNotEmpty(T)(T a){ auto b=text(a); if(b.length)