<div class="gmail_quote">On Mon, Sep 27, 2010 at 19:20, Simen kjaeraas <span dir="ltr">&lt;<a href="mailto:simen.kjaras@gmail.com">simen.kjaras@gmail.com</a>&gt;</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&#39;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&#39;t think it&#39;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 &#39;variables&#39;.I cannot find a way to change a cow state from alive to dead. <br>
Encoding the cow&#39;s state in its type is no good either, as you cannot change a cow&#39;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&#39;d doable. Didn&#39;t Don say we should get classes and pointers at CT at some time?<br>
<br><br>Philippe<br><br></div></div>