On 08/18/2012 04:07 PM, bearophile wrote:
On Reddit I have found a little C++11 program, here a little reformatted:
http://ideone.com/Vzkt8
The C++11 program implements a Turing machine at compile time, using two
compile-time linked lists to represent each half of the tape (in such
lists the ends handily loop on themselves). And then the Turing machine
is programmed with a Busy Beaver.
So I have tried to port it to D, but it doesn't work yet, I have
troubles with the template pattern matching (some programs related to
this have given me optilink errors, but here the problem is different
and larger):
http://dpaste.dzfl.pl/3195c63f
In this D version D I have kept the original structure, so I have not
used two TypeTuples, also because of the loops at the list ends.
This D code is not going to be used for practical work. But do you know
how to fix/improve it?
Bye, and thank you,
bearophile
Took me a while! Phew... :)
http://dpaste.dzfl.pl/6b362382
I had lots of trouble matching the template specialization that I
needed. And a million silly mistakes of mine. Anyway... Produces the
same output.
Ali
--
D Programming Language Tutorial: http://ddili.org/ders/d.en/index.html