I'm looking for a lightweight alternative to inline code listings that is able to make keywords bold. I'm imagining something like the following:
\declarekeywords{if,then,else}
\declarestylecommand\textbf
The expression \texttt{\stylekeywords{if a then b else c}} evaluates to ...
should expand to:
The expression \texttt{\textbf{if} a \textbf{then} b \textbf{else} c} evaluates to ...
The idea is that this command can be adapted to work in many different contexts, for example math mode:
\stylekeywords{let $x = a + b$ in $f(x)$}