refactor
Zipped through the cru-top.pl code and refactored a bunch of mid-level stuff that was being repeated a lot. Here's an example of a refactor... a chunk of code that was repeated in 14 places:
read_grammar(FileRoot,StartSymbols,GrammarRules) :-
string_append(FileRoot,'.start',StartFile),
string_append(FileRoot,'.gram',GrammarFile),
string_append(FileRoot,'.types',TypesFile),
ensure_loaded(TypesFile),
commentsChar(C),
see(StartFile),
readfile(StartSymbolsStrings,C),
seen,
strings2terms(StartSymbolsStrings,StartSymbols),
see(GrammarFile),
readfile(GrammarRulesStrings,C),
seen,
strings2terms(GrammarRulesStrings,GrammarRules).
This kind of code-tidy-up is pretty mindless, but it is useful for somebody like me. You just rip out pieces and put them back together, watching out for interleaved fragments, translating
from
foo, tell, foo, bar, told to
foo, tell, foo, told, tell, bar, told so that you can peel off the
fooey bits as one lump.
The reason this was useful is that it gave me a very concrete feel for the top level code... forced me to look at the bits instead of just eye-glazing over them and to think about what was going on. I kinda wonder if it would be an effective pedagogical technique to purposely de-factor some code before giving it to a new (and fussy) programmer. Once he's through sweeping up, he'll have a good idea what's going on.
Anyway now I know basically how those mid-level chunks fit together. I'm a bit losing sight of the Mission though, and need to re-evaluate what I'm doing in that context. This refactoring is basically me running around like a headless chicken.
Need to see how the language models are used for example. Thanks to the refactor, I know that we read them in as Prolog files, a supplementary resource. But I don't know much else.
uncooperative
Spent a small chunk of the afternoon in uncooperative mode. Visited the uni library and read a bit
dossier de qualification
Here's where the sad-face tag comes in. I've been working on the dossier de qualification again. Dossier, I hate you. I thought it would be a good idea to go through the CNU advice like a checklist. Check-check-check, what... I have to write up a
projet d'enseignement? That stank. Especially what I wrote. Will certainly be in a much better mood when the deadline has passed and this is out of my hands one way or another.