iopipe v0.1.0 - now with Windows support!
Steven Schveighoffer
schveiguy at yahoo.com
Wed Jun 13 16:03:38 UTC 2018
On 6/13/18 8:35 AM, bauss wrote:
> Does iopipe work with CTFE?
It may work in some cases. Some of the things it does are not conducive
to CTFE working well -- like using a buffer. But generally at compile
time, you don't want to use a buffer.
But I would expect, for instance, using algorithms and iopipes on a
string would probably work.
hm... just thought I'd try it:
import std.range : walkLength;
static
assert("hello\nworld\nthis\nis\na\ntest".byLineRange.walkLength == 6);
It didn't work at first, as I'm using memchr for searching for the
newlines, but with a nice little if(__ctfe) override, it works just great!
I'm going to push this (I'll do some tests for the other widths to make
sure it works for all UTF), but if you have any more things you want to
work at CTFE, submit some issues on the github project.
I don't expect a lot of the array casting stuff to work, but maybe there
are ways. I actually never thought much about making it work at
compile-time. I suppose though, it would be cool to import a file at
compile time, and generate the JSON or XML DOM at compile time too :)
I think zip and unzip are never going to work since the underlying C
calls are not CTFE-able.
-Steve
More information about the Digitalmars-d-announce
mailing list