FWIW, it’s pretty easy to pull out the first conditional (cond, case, or if) when you have code in fully expanded form (which turns them all into ifs). However, that just puts you in a position of checking whether a predicate is #t or #f, which isn’t much easier than discovering whether a program returns 'C or 'D. Ultimately, your MimicBot idea is better :-)
Nice. But no. My first attempt was a static analyzer, and the first thing it did was a syntax expansion, putting all code into fully expanded form) and attaching lexical information to each identifier that let me see what was from the base package and what was redefined.
FWIW, it’s pretty easy to pull out the first conditional (cond, case, or if) when you have code in fully expanded form (which turns them all into ifs). However, that just puts you in a position of checking whether a predicate is
#t
or#f
, which isn’t much easier than discovering whether a program returns'C
or'D
. Ultimately, your MimicBot idea is better :-)