Hello,
I came back to D after a longer break and just wanted to set up a
small project to further get in contact with this language.
However, it seems that the codes which simply shall simulate a
deterministic finit automaton do not work correctly.
CODE ---
struct DeterministicState {
publ
Hiho,
thank you for your response on my topic.
However, I still do not understand why it didn't work for struct
value types since I do not perform any mutations on the state
objects during execution of the code.
The only thing happening with them is that they are getting
copied bitwise and
Hiho,
thank you for your response!
You just showed me my flaws while programming with value types. I
think the only close solution is to work with pointers to the
created states within the associative array instead of direct
value types.
Thanks for clearing this up to me. =)
Regards,
Rob
Here is the fully working code for everyone experiencing similar
bugs or problems with pointers and value types. =)
struct DeterministicState {
public:
this(string name, bool isFinal, DeterministicState *[char]
transits...) {
this.name = name;
this.finalState =
This is actually a good question as this code isn't really
complex or doesn't require the best possible performance.
But in case I will ever need optimum performance I should have
learned how to handle tasks with value types which is the main
reason why I chose them instead of reference types -
Hiho,
as I am currently very insterested in compiler implementation I
often look into the DMD github and look how things are done
there. Often I find myself curious about things at first but find
out the rational behind certain implementation decisions.
One thing I can't figure out is the di
Thank you for your reply. I didn't know that it isn't possible to
overload the post-inc and decrement operators in Dlang but I
think I don't even miss this feature if pre-inc/dec is still
available. =)
Hi. I like to learn programming by examples but I need help
learning how to read documentation. I have some idea of how it
works in some aspects but in others i get completely stuck
because there are no examples or code snippets.
I am using dgame (dgame-dev.de) and im reading the documentation
On Friday, 2 October 2015 at 01:20:50 UTC, Adam D. Ruppe wrote:
On Thursday, 1 October 2015 at 19:15:39 UTC, Robin wrote:
[...]
Those describe simple class members, so you can set them
through assignment:
Text CurrentFps = new Text(dejavu);
// change to white on black
Current