Re: DUB: can I fully control the output file name?

2016-08-09 Thread lobo via Digitalmars-d-learn
On Wednesday, 10 August 2016 at 00:27:44 UTC, lobo wrote: On Tuesday, 9 August 2016 at 08:49:43 UTC, timepp wrote: [...] Have you tried "targetName":"tckeyex.wdx" ? To get a different name for 32/64 bit you may require a configuration for each and run $ dub build -cx86 release $ dub build

Re: DUB: can I fully control the output file name?

2016-08-09 Thread lobo via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 08:49:43 UTC, timepp wrote: I'm writing a Total Commander plugin, which has the "wdx" file extension, so I wish to let dub generate xxx.wdx directly but not xxx.dll. How can I write my file to achieve this goal? --- my dub.json: { "name": "tckeyex", "ta

Re: I thought mixins didn't override?

2016-08-09 Thread ag0aep6g via Digitalmars-d-learn
On 08/10/2016 12:10 AM, Engine Machine wrote: I try to use a mixin template and redefine some behaviors but D includes both and then I get ambiguity. I was sure I read somewhere that when one uses mixin template it won't include what is already there? mixin template X { void foo() { } } stru

Re: I thought mixins didn't override?

2016-08-09 Thread Ali Çehreli via Digitalmars-d-learn
On 08/09/2016 03:10 PM, Engine Machine wrote: > I try to use a mixin template and redefine some behaviors but D includes > both and then I get ambiguity. It's not always possible to understand without seeing actual code. > I was sure I read somewhere that when one > uses mixin template it won't

I thought mixins didn't override?

2016-08-09 Thread Engine Machine via Digitalmars-d-learn
I try to use a mixin template and redefine some behaviors but D includes both and then I get ambiguity. I was sure I read somewhere that when one uses mixin template it won't include what is already there? mixin template X { void foo() { } } struct s { mixin template void foo() { } }

Re: C-binding external array.

2016-08-09 Thread Ali Çehreli via Digitalmars-d-learn
On 08/09/2016 11:46 AM, ciechowoj wrote: > On Tuesday, 9 August 2016 at 15:41:08 UTC, Steven Schveighoffer wrote: >> @property int* tabp() { return tab.ptr; } >> >> tabp[elem]; > > This is nice. The best would be to have it with the same name as > original symbol, but I can't imagine how it could

Re: C-binding external array.

2016-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/16 2:46 PM, ciechowoj wrote: On Tuesday, 9 August 2016 at 15:41:08 UTC, Steven Schveighoffer wrote: Well, you can via properties: @property int* tabp() { return tab.ptr; } tabp[elem]; This is nice. The best would be to have it with the same name as original symbol, but I can't imagin

Re: C-binding external array.

2016-08-09 Thread ciechowoj via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 15:41:08 UTC, Steven Schveighoffer wrote: Well, you can via properties: @property int* tabp() { return tab.ptr; } tabp[elem]; This is nice. The best would be to have it with the same name as original symbol, but I can't imagine how it could be done. Essentiall

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:30:21 UTC, Seb wrote: There is also https://github.com/ikod/dlang-requests Which I find in general more intuitive to use ;-) Interesting, I'd not come across that before. Thanks -- I'll give it a glance some time ...

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:21:09 UTC, ketmar wrote: http://dpldocs.info/experimental-docs/std.net.curl.HTTP.setPostData.html https://dlang.org/phobos/std_net_curl.html#.HTTP.setPostData reading documentation rox! Yea, mea culpa. I had actually glanced at that but was asking on the assu

Re: C-binding external array.

2016-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/16 11:41 AM, Steven Schveighoffer wrote: extern(C) int tabLength(); // mythical mechanism or no? @property int[] dtab { return tab.ptr[0 .. tabLength]; } And I've used mythical syntax also! Should be: @property int[] dtab() { return tab.ptr[0 .. tabLength]; } -Steve

Re: arrays, mmu, addressing choices

2016-08-09 Thread LaTeigne via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 15:29:43 UTC, LaTeigne wrote: On Monday, 8 August 2016 at 21:45:06 UTC, Charles Hixson wrote: by the way, you are Jonathan M Davis right ?

Re: C-binding external array.

2016-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/16 10:09 AM, ciechowoj wrote: On Tuesday, 9 August 2016 at 14:01:17 UTC, Steven Schveighoffer wrote: I think this should work: extern extern(C) int[1] tab; Then if you want to access the elements, use the tab.ptr[elem] If it's a global variable, tack on __gshared. I've already trie

Re: arrays, mmu, addressing choices

2016-08-09 Thread LaTeigne via Digitalmars-d-learn
On Monday, 8 August 2016 at 21:45:06 UTC, Charles Hixson wrote: I have a rather large array that I intend to build. but much of it will only occasionally be used. Will the unused sections automatically be paged out? If it matters my system is Debian Linux. This array will be indexed by a ul

Re: LDC with ARM backend

2016-08-09 Thread Claude via Digitalmars-d-learn
On Monday, 1 August 2016 at 06:21:48 UTC, Kai Nacke wrote: Thanks! That's really awesome! Did you manage to build more complex applications? EABI is a bit different from the hardfloat ABI and there may be still bugs lurking in LDC... Unfortunately no, I didn't have the time. I was intereste

Re: C-binding external array.

2016-08-09 Thread ciechowoj via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:25:15 UTC, Kagamin wrote: Well extern extern(C) __gshared int[64] tab; My assumption is you do not know the size of the array.

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Seb via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:07:48 UTC, Joseph Rushton Wakeling wrote: Hello all, I'm currently writing a little client app whose job is to make a POST request to a vibe.d webserver and output the response. However, vibe.d is picky about the content-type of the request body, and so far as

Re: C-binding external array.

2016-08-09 Thread Kagamin via Digitalmars-d-learn
Well extern extern(C) __gshared int[64] tab;

Re: Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread ketmar via Digitalmars-d-learn
http://dpldocs.info/experimental-docs/std.net.curl.HTTP.setPostData.html https://dlang.org/phobos/std_net_curl.html#.HTTP.setPostData reading documentation rox!

Re: C-binding external array.

2016-08-09 Thread ciechowoj via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 14:01:17 UTC, Steven Schveighoffer wrote: I think this should work: extern extern(C) int[1] tab; Then if you want to access the elements, use the tab.ptr[elem] If it's a global variable, tack on __gshared. -Steve I've already tried this and works (64-bit at lea

Specifying content-type for a POST request using std.net.curl

2016-08-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
Hello all, I'm currently writing a little client app whose job is to make a POST request to a vibe.d webserver and output the response. However, vibe.d is picky about the content-type of the request body, and so far as I can see there is no way to specify this via the `std.net.curl.post` API

Re: C-binding external array.

2016-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/16 9:53 AM, ciechowoj wrote: Is there a way to access a static array from D without knowing the size of the array? Let suppose there is an array, somewhere in lib.c. int tab[64]; and there is header file lib.h with following reference: extern int tab[]; How to declare `tab` in the D c

C-binding external array.

2016-08-09 Thread ciechowoj via Digitalmars-d-learn
Is there a way to access a static array from D without knowing the size of the array? Let suppose there is an array, somewhere in lib.c. int tab[64]; and there is header file lib.h with following reference: extern int tab[]; How to declare `tab` in the D code without knowing the size of the

Re: UFCS with implicit "this" ?

2016-08-09 Thread cy via Digitalmars-d-learn
On Tuesday, 9 August 2016 at 05:33:09 UTC, Jonathan M Davis wrote: Personally, I think that you should just make it a member function if it's not a generic function, but to each their own, Well, I use generics for when I have like, optional functionality that isn't inherent to the class itself

Re: DUB: can I fully control the output file name?

2016-08-09 Thread rikki cattermole via Digitalmars-d-learn
On 09/08/2016 8:49 PM, timepp wrote: I'm writing a Total Commander plugin, which has the "wdx" file extension, so I wish to let dub generate xxx.wdx directly but not xxx.dll. How can I write my file to achieve this goal? --- my dub.json: { "name": "tckeyex", "targetType": "dynamicLib

DUB: can I fully control the output file name?

2016-08-09 Thread timepp via Digitalmars-d-learn
I'm writing a Total Commander plugin, which has the "wdx" file extension, so I wish to let dub generate xxx.wdx directly but not xxx.dll. How can I write my file to achieve this goal? --- my dub.json: { "name": "tckeyex", "targetType": "dynamicLibrary", "description": "A minimal