On 10.08.2011 18:54, Jacob Carlborg wrote:
Interesting idea, one problem with it is that I want this:

auto m = match("bleh", "bleh");
writeln(m);

to actually print "bleh", not true
Right now due to a carry over bug from std.regex (interface thing)
writln(m) will just do a stackoverflow, m.hit however works.

No, that won't be any problem:

struct Foo
{
    bool b;
    alias b this;
}

auto f = Foo();
static assert(is(typeof(f) == Foo));

The above assert passes as expected.
That may be all well, but  try writeln on it, what will it print?
After some experience with alias this I had to conclude that it's rather blunt tool, and I'd rather stay away of it. Actually I like Steven's opCast suggestion, so that it works in conditionals.


Aren't there a lot of things that should be declared as private in the
fred.d module?


Yes, it's a side effect of me having a lot of debugging tool that do
need these internals. If only package protection attribute of something
was working....
Not to mention that the whole module should work in SafeD with a couple
of @trusted here and there.

Ok, I see.



--
Dmitry Olshansky

Reply via email to