22 Oct 2008 tampe   » (Journeyer)

Enjoy being wrong and you will do right

I have piled up quite a lot of the loop stuff, time to actually make it work. The stuff has grown and I need to start considering how the code should look like when using the machinery. I want to remove the dot in .+ .* and so on in the default mental model and instead use some kind of mark if you want to use the original function.

Actually variables V that contain generators comes in three mental models. (At least that's my conclusion)

1. V is updated at the locations they are defined in the loop, but values are collected wherever they are present if it is in a "return value position" - this should be the default in order to get loop of loops correct

2. V are updated whenever they are present in the evaluation paths if using these variables be sure to mark them with like ?V? or something (The question is if they are useful) but it is a mental model that is consistent

3. V has to explicitly be updated (so we should do a .V or something to mark them special) These Variables has it's uses but it is not that common

It is interesting to note that functions invocation has to be manipulated for cases like

   (f (sum V)  H K)
if the function has a switch like if or case statement (switching the next value evaluation between) you will get the wrong behavior so again you would like to translate this to

  (.let ((A (sum V))) ((f A H K))

As you all noticed the code I present here is not 100% working, actually they are more or less dysfunctional but that's ok, I usually spend the night correcting the mistakes. I consider it more important for my development to enter stuff into this diary than to keep it absolutely 100% correct. The thing is that it is a nice exercise to try formulate the abstractions floating in the head with words and it's a good creative stimulus.

I'm not happy with the parser examples but decided to push down the importance to perfect that development until I have a working copy of all the current ideas, cleaned it up, and release it under some project name. The code will be working but not especially useful because it's main purpose is to be a functional specification from which you can deduce unit-tests. Yes!, the specification documentation is code!


Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!