Re: how to correctly 'typedef' handle types

2014-06-20 Thread francesco cattoglio via Digitalmars-d-learn
http://dlang.org/phobos/std_typecons.html#Typedef Take a look at it. Docs is scarce (pretty sure you will need to take a look around to find something) but it should just do what you need.

Re: DUB linking problem on WinXp

2014-06-20 Thread Orfeo via Digitalmars-d-learn
Well, after many attempts, I have found what is causing the problem. My dub.json : ``` { name: ddb_test, description: A minimal D application., dependencies: { gtk-d:gtkd: =2.3.3, ddb: =0.2.1 } } ``` My source (source/app.d): ``` import ddb.postgres; import

Re: Some kind of RPC exists for D?

2014-06-20 Thread Bienlein via Digitalmars-d-learn
What data load profile do you expect? Vibe is tuned to handle thousands simultaneous incoming light requests (milliseconds), while distributed computing works better with exclusive heavy requests, at least minutes of work worth, BOINC uses hours worth work items. Communication will be

Re: how to correctly 'typedef' handle types

2014-06-20 Thread via Digitalmars-d-learn
On Friday, 20 June 2014 at 07:05:49 UTC, francesco cattoglio wrote: http://dlang.org/phobos/std_typecons.html#Typedef Take a look at it. Docs is scarce (pretty sure you will need to take a look around to find something) but it should just do what you need. The prerelease docs contain more

C structs

2014-06-20 Thread Johann Lermer via Digitalmars-d-learn
Hi, I'm fiddling around with cairo (downloaded fromhttps://github.com/D-Programming-Deimos/cairo) and I stumbled over this problem: (file rectandmatrix.d) import deimos.cairo.cairo; void main () { cairo_rectangle_int_t rect; cairo_matrix_t matrix; } Compiling that with

Re: C structs

2014-06-20 Thread Kagamin via Digitalmars-d-learn
On Friday, 20 June 2014 at 10:51:20 UTC, Johann Lermer wrote: `_D6deimos5cairo5cairo14cairo_matrix_t6__initZ' it's an init value for the struct; in D all data is initialized.

Re: Working on a library: request for code review

2014-06-20 Thread Mike via Digitalmars-d-learn
Do you think it's ready for a v0.1 release? It be willing to add it to dub if it passes general D coding stardards. Once again, thanks for feedback and vast improvements of the code. Best, Mike

Re: Some kind of RPC exists for D?

2014-06-20 Thread Dicebot via Digitalmars-d-learn
On Friday, 20 June 2014 at 08:05:01 UTC, Bienlein wrote: What data load profile do you expect? Vibe is tuned to handle thousands simultaneous incoming light requests (milliseconds), while distributed computing works better with exclusive heavy requests, at least minutes of work worth, BOINC

Re: C structs

2014-06-20 Thread Dicebot via Digitalmars-d-learn
By D specification you are always required to compiled all imported modules, it does not matter if those contain only definitions. Some of implicitly generated symbols (like T.init) will be in their object files.

Re: C structs

2014-06-20 Thread Johann Lermer via Digitalmars-d-learn
Agreed, but I assumed, that since all definitions in cairo.d are defined as extern (System), (same happens with extern (C), btw.), I would have expected, that D does not implicitly generate initialisation functions. So, why is there no init routine for the rectangle? There's only one for the

Re: C structs

2014-06-20 Thread Dicebot via Digitalmars-d-learn
On Friday, 20 June 2014 at 12:17:22 UTC, Johann Lermer wrote: Agreed, but I assumed, that since all definitions in cairo.d are defined as extern (System), (same happens with extern (C), btw.), I would have expected, that D does not implicitly generate initialisation functions. D requires

how to resolve matches more than one template declaration?

2014-06-20 Thread Juanjo Alvarez via Digitalmars-d-learn
Hi, Newbie question: void foo(S)(S oneparam){} void foo(S)(S oneparam, int anotherParam){} alias fooStr = foo!string; Gives: Error: template test.foo matches more than one template declaration: How could I fix it so the alias aliases one of the two versions? Also, why can't fooStr be an

Re: how to resolve matches more than one template declaration?

2014-06-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Fri, 20 Jun 2014 20:40:49 + Juanjo Alvarez via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi, Newbie question: void foo(S)(S oneparam){} void foo(S)(S oneparam, int anotherParam){} alias fooStr = foo!string; Gives: Error: template test.foo matches more than one

template mixins for boilerplate

2014-06-20 Thread Paul D Anderson via Digitalmars-d-learn
I am misunderstanding something about using mixins for boilerplate code. I've got a set of functions all of which do the same thing: public static int fctn1() { return other.place.fctn1; } I can't use a string mixin to generate the code: template Function(string name) { const char[]

Re: rehabilitating Juno

2014-06-20 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 19 June 2014 at 15:24:41 UTC, Jesse Phillips wrote: Once I get some examples compiling again in 32bit, it should be easier for you to play around with COM in D. I've pushed changes which get the library building and examples working. Let me know if there is any other direction I

Re: template mixins for boilerplate

2014-06-20 Thread Philippe Sigaud via Digitalmars-d-learn
Use a string mixin? string fun(string name) { return public static int ~ name ~ () { return 0; }; } struct S { mixin (fun(fctn1)); } void main() { S s; import std.stdio; writeln(s.fctn1()); }

enum functions

2014-06-20 Thread Paul D Anderson via Digitalmars-d-learn
Does enum have any effect on functions? Is this: mixin (Constant!(ln2)); package enum T ln2(T)(Context context) { return log(T.TWO, context, false); } different from this: mixin (Constant!(ln2)); package /*enum*/ T ln2(T)(Context context) { return log(T.TWO, context, false); }