<div class="gmail_quote">On Mon, Sep 27, 2010 at 19:20, Simen kjaeraas <span dir="ltr"><<a href="mailto:simen.kjaras@gmail.com">simen.kjaras@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Here's mine ( 8/11 at compile-time, the remaining at runtime ):<br>
<a href="http://ideone.com/6WlFJ" target="_blank">http://ideone.com/6WlFJ</a><br>
I don't think it's possible to make it better than that in D without,<br>
as you say, for instance type states.<br></blockquote><div><br>Yeah, I concur. OK for doing the first 8 tests at CT. But at CT you have only enums, so you cannot reassign 'variables'.I cannot find a way to change a cow state from alive to dead. <br>
Encoding the cow's state in its type is no good either, as you cannot change a cow's type. I think OCaml does it with algebraic data types. These are doable in D, but only testable at runtime...<br><br>If pointers were available at compile-time, it'd doable. Didn't Don say we should get classes and pointers at CT at some time?<br>
<br><br>Philippe<br><br></div></div>