On 8/10/11 11:43 PM, Marco Leise wrote:
Am 10.08.2011, 22:49 Uhr, schrieb Timon Gehr <[email protected]>:
Marco Leise wrote:
For starters, how about this?:
static string someExternalText = __ctfeReadFile("external.txt");
static byte[] chipInitialState = __ctfeReadFile("initial_state.bin");
static string someExternalText = import("external.txt");
static byte[] chipInitialState = import("initial_state.bin");
(You need to pass the -Jpath switch)
Oh err, well. I was a little behind time it seems *g*.
So Ary Manzana was wrong saying "I think it's possible, though CTFE
can't access outside resources."
Well, you can't really use import() from CTFE, the file name must be a
compile-time constant. This would make things like importing other files
based on include statements in some file cumbersome, as you would have
to resort to a strange combination of templates and CTFE.
David