www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.algorithm.filter cannot call gc_malloc at compile time

reply "Meta" <jared771 gmail.com> writes:
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?
Jul 09 2013
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
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?
Jul 09 2013
parent reply "Meta" <jared771 gmail.com> writes:
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!
Jul 09 2013
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
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"
Jul 09 2013
next sibling parent "Meta" <jared771 gmail.com> writes:
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.
Jul 09 2013
prev sibling parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
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...?
Jul 09 2013
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
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.
Jul 09 2013