Monday, April 17, 2006

Finding contentment....

It's odd I haven't really found much to post about in the last few weeks.

I really think I ought to update this more often. In the mean time I've got myself an LJ account so I can read friends locked posts. Apparently on LJ you can keep posts private for friends. I can understand why though.

Anyway I've hand a contented Easter, spending time with my SWMBO. Much domestic stuff has been done.

The domesic stuff left me in an odd nimd state, so searching through old project I pulled up an old piece of code which I wrote for DOS 'back in the day' as they say. Unfortunately the way it was structed push the limits of he compiler (TP7) I using back then.

About 4 years ago I tried to rewrite the code using 'STL-style' in C++ they I could continue trying to play wiht the new idea the code encapsulates.

Yes, I'm not telling you what it does.

When I first wrote the code I had problems with 'value<->instance' equavalence as I had used STL container to try to store instances. Which of course isn't really what the STL does , as the STL has value containers.

In the meantime I've gather quite a bit of experience and understanding of the STL . So I thought I'd tidy it up and see If I could get it working.

As I said this was an historic project so I discovered that the basic Makefile I had used didn't use -Wall , as a result I missed the function where I forgot to include 'return foo;' which TP didn't need. These days I tend to adapt Makefiles from my last project.

Of course it still doesn't work for some reason the following code doesn't work.

               foo::iterator   end=a.end();
               foo::iterator   point=a.begin();
               .
               .
               
               .
               .
               if (point == end ) { ... }
Why I'm not sure. I need to check the STL spec, or look for a bug elsewhere.

1 Comments:

Blogger Roger said...

Well. I've got that working.

It was a couple of completly different bugs, related
to the way I managed on of my other lists.

The program in question is usually written recursivley and the recursion a loci. It is this loci which is the output I want.

I decided to have a ago and rewritting the recursive algorithm as a loop. Straightforawrd enough with dymnaic store. That means I could expose the loci walking API as an iterator in C++ style.

Unfortunaltely using std::list<> to manage pseudo-stack frames has a few catches...

10:41 pm  

Post a Comment

Links to this post:

Create a Link

<< Home