Re: LuaD + VisualD link issue

2015-05-20 Thread PhilipDaniels via Digitalmars-d-learn
On Tuesday, 12 August 2014 at 22:25:24 UTC, Johnathan Sunders wrote: I'm having an issue with building programs that link with LuaD using VisualD. If I use Dub, it builds without an issue, but generating a project file and compiling it through VisualD results in "Error 162: Bad Type Index refer

Re: Baffled by compilation error for formattedRead

2015-05-07 Thread PhilipDaniels via Digitalmars-d-learn
On Thursday, 7 May 2015 at 23:23:08 UTC, Justin Whear wrote: formattedRead takes its input by ref and consumes it. Your first two attempts are both passing the result of functions (dropExactly and opSlice) which are temporary rvalues and can thus not be passed by reference. Here's more readin

Re: Baffled by compilation error for formattedRead

2015-05-07 Thread PhilipDaniels via Digitalmars-d-learn
On Thursday, 7 May 2015 at 23:10:26 UTC, PhilipDaniels wrote: Let's try reformatting that... ubyte r, g, b; // does not compile auto numRead = formattedRead(dropExactly(input, 4), "%x/%x/%x", &r, &g, &b); // does not compile auto numRead = formattedRead(input[4..$], "%x/%x/%x", &r, &g, &b);

Baffled by compilation error for formattedRead

2015-05-07 Thread PhilipDaniels via Digitalmars-d-learn
Given a string string input = "rgb:20/30/40"; And the following: ubyte r, g, b; auto numRead = formattedRead(dropExactly(input, 4), "%x/%x/%x", &r, &g, &b); // does not compile auto numRead = formattedRead(input[4..$], "%x/%x/%x", &r, &g, &b);// does not c

Re: Create a case-insensitive startsWith

2015-04-29 Thread PhilipDaniels via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 22:34:07 UTC, Justin Whear wrote: if (startsWith!"icmp(a, b) == 0"(input, "0x")) if (startsWith!"std.uni.icmp(a, b) == 0"(input, "0x")) if (startsWith!((a,b) => icmp(a,b) == 0)(input, "0x")) The issue is that those icmp functions take strings as arguments

Create a case-insensitive startsWith

2015-04-28 Thread PhilipDaniels via Digitalmars-d-learn
Beginner question. Given if (startsWith(input, "0x", "0X")) How do I turn that into a case-insensitive startsWith? startsWith says it takes a predicate but I can't figure out how to pass it one. The examples all use "a == b" !? These attempts below, and other things I have tried, fail with