Vladimir Panteleev wrote:
On Fri, 13 Nov 2009 22:17:21 +0200, Bill Baxter <[email protected]> wrote:

My plan is to try to do things with an API that reflects std.string as
closely as possible, and then as CTFE gets better, just replace those
functions with aliases to the ones in std.string.  So eventually
std.metastrings should contain little more than a bunch of aliases.
But in the mean time there'll be a one-stop shop for basic
compile-time string manipulation functions.

Why don't we have version(CTFE) or something like that yet? Then we can just have two versions of code for most of std.string - one optimized for runtime execution, and one adhering to CTFE restrictions. That would remove the need to write two versions of a function which would be called both during compile-time and runtime (one using std.metastrings and one using std.string).

Yes, I think it's something we need. I've worked out how to do it, but haven't implemented it yet. There's way too much to do...

It would fit very nicely into the 'meta' proposal. EG
if (meta.ctfe) { ... } else { ... }

Reply via email to