Debuging Part 1
I am debugging the following program below. It is working as expected but
I still don't get it. I followed some programming pattern, and then magically
it work. But I had to debug it to get what is really happenning. I inserted
show statements(print) around the code to print out the the list
as the program is running.
Now i wanted to say a word about debugging skills for beginner programmers. this
is a must have skills. Knowing where to insert your print statements and possibly
using stop command is key. I like the vba debug invironment and i have realised
I am more productive under vba than most platforms, thanks to the debugger.
The debugger is really key. A nice idea like vba enviroment can help beginner
programmers understand whats going on behind the hood. Insert those stop
statements around the code and seeing what the program is doing while it
it is running is really key.
I still don't get it. I followed some programming pattern, and then magically
it work. But I had to debug it to get what is really happenning. I inserted
show statements(print) around the code to print out the the list
as the program is running.
Now i wanted to say a word about debugging skills for beginner programmers. this
is a must have skills. Knowing where to insert your print statements and possibly
using stop command is key. I like the vba debug invironment and i have realised
I am more productive under vba than most platforms, thanks to the debugger.
The debugger is really key. A nice idea like vba enviroment can help beginner
programmers understand whats going on behind the hood. Insert those stop
statements around the code and seeing what the program is doing while it
it is running is really key.
;P08 (**) Eliminate consecutive duplicates of list elements.
;If a list contains repeated elements they should be replaced
;with a single copy of the element. The order of the elements should not be changed.
;Example:
;* (compress '(a a a a b c c a a d e e e e))
;(A B C A D E)
to compress :list
;show :list
ifelse emptyp butfirst :list
[output []]
[ifelse equalp (first :list) (first butfirst :list)
[output compress butfirst :list]
[show :list
show first :list
output sentence first :list compress butfirst :list]]
end
show compress [a a a a b c c a a d e e e e]
Comments