Hi guys,
I have some questions:
With the time I gain more experience/skill writing lisp codes, but additional problems came up - the last written codes are becomming longer and longer, and harder to debug.
I tried to reduce this syntax identing/unfolding (not sure how its called - 'stacking the syntaxes' I guess) so the formatting would be worse, but that way I could see more lines of the code at the monitor. I've seen that its more important to structure the whole program into "blocks", and define more subfunctions to reduce the main program's length.
1. So what would be the best way to structure very long program?
2. How you deal with very long codes (where you have to scroll several times, to see the matching closing parenthesis/syntax) ?
3. Overall, how do you understand whats happening, when you strike a error upon loading, which could not be fixed with Vlide->Debug->Last Break Source (because its some syntax error - where somewhere in your code you misplaced the opening and closing syntax - and you have to find the problem 'manually')
Personally, as I said I started to organize the program structure into such "blocks" (the programming term). And when I have to find any problem manually, I start to "comment" blocks of the program (using remove-until-find method) to determine inside which "block" the program fails.
Do you have any additional advices?
Say syntaxes in your code go like this (and I consider it as a mid-long code):
( ()
(
)
(
(
(
(
(
)
)
)
)
)
(
(
)
)
()
(
(
(
(
)
)
)
)
(
)
(
)
(
(
(
(
(
(
(
(
)
)
)
)
)
)
()
)
(())
)
(
(
(
(
(
)
)
(
(
(
(
)
)
)
)
(
(
)
)
)
)
)
()
)
And heres what I mean, by re-structure such as "block" use:
( ()
()
(( ; Block #1
(
(
(
)
)
)))
(())
()
( ; Block #2
(
(
(
)
)
))
()
()
( ; Block #3
(((
(
(
(
(
)
)
)
)
))())(()))
( ; Block #4
(
(
(())
(
(
(
(
)
))
)
(
(
)
))
)
)
()
); defun