Thread overview
std.algorithm.filter cannot call gc_malloc at compile time
Jul 09, 2013
Meta
Jul 09, 2013
John Colvin
Jul 09, 2013
Meta
Jul 09, 2013
John Colvin
Jul 09, 2013
Meta
Jul 09, 2013
monarch_dodra
Jul 09, 2013
John Colvin
July 09, 2013
enum tokenRange = matchStr.split(",")
			  .map!(a => a.findSplit(`=>`)
				      .array
				      .map!strip)
			  .filter!"!a.empty";

This won't compile. The error message is:

.../core/memory.d(337): Error: gc_malloc cannot be interpreted at compile time, because it has no available source code

Is there some way I can work around this?
July 09, 2013
On Tuesday, 9 July 2013 at 16:28:21 UTC, Meta wrote:
> enum tokenRange = matchStr.split(",")
> 			  .map!(a => a.findSplit(`=>`)
> 				      .array
> 				      .map!strip)
> 			  .filter!"!a.empty";
>
> This won't compile. The error message is:
>
> .../core/memory.d(337): Error: gc_malloc cannot be interpreted at compile time, because it has no available source code
>
> Is there some way I can work around this?

Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using?
July 09, 2013
On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote:
> Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using?

I'm using DPaste, but setting the compiler to use the latest from GIT fixed it. Thanks!
July 09, 2013
On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote:
> On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote:
>> Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using?
>
> I'm using DPaste, but setting the compiler to use the latest from GIT fixed it. Thanks!

which dpaste is that? http://dpaste.dzfl.pl/ gives me the error even using "dmd 2.X Git"
July 09, 2013
On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote:
> which dpaste is that? http://dpaste.dzfl.pl/ gives me the error even using "dmd 2.X Git"

Actually, yes, it still does not work. I forgot that I had changed "enum" to "auto" to get it working. My bad.
July 09, 2013
On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote:
> On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote:
>> On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote:
>>> Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using?
>>
>> I'm using DPaste, but setting the compiler to use the latest from GIT fixed it. Thanks!
>
> which dpaste is that? http://dpaste.dzfl.pl/ gives me the error even using "dmd 2.X Git"

It's working for me on my local head. FYI, the problem was fixed about a month ago:
https://github.com/D-Programming-Language/phobos/pull/1305

It doesn't work in my 2.063.2 though.

"dmd 2.X Git" is probably not refreshed very often...?
July 09, 2013
On Tuesday, 9 July 2013 at 19:06:36 UTC, monarch_dodra wrote:
> On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote:
>> On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote:
>>> On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote:
>>>> Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using?
>>>
>>> I'm using DPaste, but setting the compiler to use the latest from GIT fixed it. Thanks!
>>
>> which dpaste is that? http://dpaste.dzfl.pl/ gives me the error even using "dmd 2.X Git"
>
> It's working for me on my local head. FYI, the problem was fixed about a month ago:
> https://github.com/D-Programming-Language/phobos/pull/1305
>
> It doesn't work in my 2.063.2 though.
>
> "dmd 2.X Git" is probably not refreshed very often...?

Apparently not. It's a pity, it's not like building dmd etc. is something that takes a long time or needs any manual intervention.