c style casts

2016-01-15 Thread Warwick via Digitalmars-d-learn
I though C style casts were not supported? But when I accidentaly did int i; if (uint(i) < length) it compiled and worked fine. Whys that?

Re: c style casts

2016-01-15 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 15 January 2016 at 10:16:41 UTC, Warwick wrote: I though C style casts were not supported? But when I accidentaly did int i; if (uint(i) < length) it compiled and worked fine. Whys that? This is not a cast. You call constructor `uint(int x)`. In the same time

Voldemort Type Construction Error

2016-01-15 Thread Nordlöw via Digitalmars-d-learn
I've made progress at the helper findingSplitter at https://github.com/nordlow/justd/blob/master/substitution.d#L122 I need this for implementing a new Phobos lazy `substitute()` (or replace). I've done most logic (AFAICT in my head) but I can't make the call to Result() work as it fails as

Re: c style casts

2016-01-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-01-15 11:16, Warwick wrote: I though C style casts were not supported? But when I accidentaly did int i; if (uint(i) < length) it compiled and worked fine. Whys that? Wouldn't a C style cast be: int i; if ((uint)i < length) ? -- /Jacob Carlborg

Re: Voldemort Type Construction Error

2016-01-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 15, 2016 14:04:50 Nordlöw via Digitalmars-d-learn wrote: > I've made progress at the helper findingSplitter at > > https://github.com/nordlow/justd/blob/master/substitution.d#L122 > > I need this for implementing a new Phobos lazy `substitute()` (or > replace). > > I've done

Re: Voldemort Type Construction Error

2016-01-15 Thread Anon via Digitalmars-d-learn
On Friday, 15 January 2016 at 14:04:50 UTC, Nordlöw wrote: What have I missed? In line 126, `static struct Result()` is a template. Either drop the parens there, or change the call on line 187 to `Result!()(haystack, needles)`.

Re: DUB & Win-10 SDK / link lib not found

2016-01-15 Thread Robert M. Münch via Digitalmars-d-learn
On 2016-01-15 00:36:57 +, Mike Parker said: Did you install DMD manually? In that case, you will usually need to edit sc.ini to point to the proper VC and Win SDK directories. The DMD installer should detect your installation and configure it for you. I use Digger, hence this might be

core.sys.posix.sys.ioctl

2016-01-15 Thread sanjayss via Digitalmars-d-learn
Is there any reason that this module is not complete for platforms other than Linux -- the ioctl() system call is common across all Unix-like OSes, so it doesn't make sense that this is only partially supported. (I am using the latest DMD).

Re: core.sys.posix.sys.ioctl

2016-01-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 15 January 2016 at 18:32:22 UTC, sanjayss wrote: Is there any reason that this module is not complete for platforms other than Linux Nobody has written it up, except the parts they use.

Re: DUB & Win-10 SDK / link lib not found

2016-01-15 Thread Josh Phillips via Digitalmars-d-learn
I also ran into this issue because I upgraded VS and removed the old version. A quick re-install with the dmd .exe fixed it.

Re: Voldemort Type Construction Error

2016-01-15 Thread Nordlöw via Digitalmars-d-learn
On Friday, 15 January 2016 at 16:51:24 UTC, Anon wrote: On Friday, 15 January 2016 at 14:04:50 UTC, Nordlöw wrote: What have I missed? In line 126, `static struct Result()` is a template. Either drop the parens there, or change the call on line 187 to `Result!()(haystack, needles)`. Ahh,

Index a parameter tuple with a run-time index

2016-01-15 Thread Nordlöw via Digitalmars-d-learn
How do I index a function parameter tuple with a run-time index?

Re: Glad and WGL

2016-01-15 Thread Josh Phillips via Digitalmars-d-learn
On Friday, 15 January 2016 at 07:37:27 UTC, Josh Phillips wrote: However I (of course) ran into new errors. Gl functions like glGetString and glGetIntegerv cause the program to crash. It appears that an opengl context is being created so I'm not sure whats causing the problem For anyone else

Re: Index a parameter tuple with a run-time index

2016-01-15 Thread anonymous via Digitalmars-d-learn
On 15.01.2016 21:42, Nordlöw wrote: How do I index a function parameter tuple with a run-time index? With a switch and a static foreach: void f(A...)(size_t i, A a) { import std.stdio: writeln; switch_: switch (i) { foreach (iT, T; A) { case iT:

Re: core.sys.posix.sys.ioctl

2016-01-15 Thread sanjayss via Digitalmars-d-learn
On Friday, 15 January 2016 at 18:34:14 UTC, Adam D. Ruppe wrote: On Friday, 15 January 2016 at 18:32:22 UTC, sanjayss wrote: Is there any reason that this module is not complete for platforms other than Linux Nobody has written it up, except the parts they use. Is the contribution process

Re: Index a parameter tuple with a run-time index

2016-01-15 Thread Meta via Digitalmars-d-learn
On Friday, 15 January 2016 at 20:48:39 UTC, anonymous wrote: On 15.01.2016 21:42, Nordlöw wrote: How do I index a function parameter tuple with a run-time index? With a switch and a static foreach: void f(A...)(size_t i, A a) { import std.stdio: writeln; switch_: switch (i)

Re: Index a parameter tuple with a run-time index

2016-01-15 Thread Meta via Digitalmars-d-learn
On Friday, 15 January 2016 at 20:42:47 UTC, Nordlöw wrote: How do I index a function parameter tuple with a run-time index? I believe it's impossible because a parameter tuple is not a runtime entity. If it was an expression tuple (a compile-time tuple of only values, no types or symbols)

Re: core.sys.posix.sys.ioctl

2016-01-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 15 January 2016 at 21:21:26 UTC, sanjayss wrote: Is the contribution process straightforward. For this, yes. Should be able to just fork druntime and edit the ioctl.d that exists to flesh it out to be more complete. Make sure it matches the original C names, values, etc., and

Re: Index a parameter tuple with a run-time index

2016-01-15 Thread Justin Whear via Digitalmars-d-learn
On Fri, 15 Jan 2016 20:52:46 +, Meta wrote: > And of course I'm proven wrong as soon as I post :) Sometimes I forget > how powerful D's code generation abilities are. Username doesn't check out, :(

Re: Index a parameter tuple with a run-time index

2016-01-15 Thread Meta via Digitalmars-d-learn
On Friday, 15 January 2016 at 21:47:21 UTC, Justin Whear wrote: On Fri, 15 Jan 2016 20:52:46 +, Meta wrote: And of course I'm proven wrong as soon as I post :) Sometimes I forget how powerful D's code generation abilities are. Username doesn't check out, :( Huh?

Re: Variable below zero but if statement doesn't grab?

2016-01-15 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 23:52:05 UTC, Basile B. wrote: On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote: On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote: On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote: On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:

Adam D. Ruppe's Minigui using example

2016-01-15 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone, I would like to use Minigui (https://github.com/adamdruppe/arsd/blob/master/minigui.d) and test it for accessibility. Does anyone have an actual example of, say, a simple form with a set of radio buttons or check boxes to start with? Thanks in advance!

Re: Adam D. Ruppe's Minigui using example

2016-01-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 16 January 2016 at 01:27:32 UTC, Andre Polykanine wrote: Does anyone have an actual example of, say, a simple form with a set of radio buttons or check boxes to start with? Thanks in advance! Sort of. I still haven't used it in a real world program so it isn't complete but

Fuck the brits

2016-01-15 Thread Basile B. via Digitalmars-d-learn
On Friday, 15 January 2016 at 22:16:09 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 23:52:05 UTC, Basile B. wrote: On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote: On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote: On Monday, 28 December 2015 at 15:07:08 UTC, jkpl

Re: Voldemort Type Construction Error

2016-01-15 Thread Kapps via Digitalmars-d-learn
On Friday, 15 January 2016 at 20:04:47 UTC, Nordlöw wrote: On Friday, 15 January 2016 at 16:51:24 UTC, Anon wrote: On Friday, 15 January 2016 at 14:04:50 UTC, Nordlöw wrote: What have I missed? In line 126, `static struct Result()` is a template. Either drop the parens there, or change the