Next: Usage, Previous: Installation, Up: Top [Contents][Index]
In this chapter, we assume that you have properly installed FoCus (see Installation), and we build a short example to get you started.
Suppose you’re writing a “quotation” library which outputs a lot of
quotations, enclosed in (back)quotes like this: ‘it is raining cats
and dogs’. If you’re doing this very often, a pattern will quickly
arise: (format t "`~A'" quotation), which you could abstract
away with a custom formatting function called quotation-formatter
for instance.
The problem, of course, is that writing this
(format t "~/quotation:quotation-formatter/" quotation)
is longer than doing it the quick’n dirty way, which is quite
frustrating. That’s where FoCus comes to the rescue. What if you had
a new format
directive, say, ~`
, that would do the quotation of its
argument? This is what we are going to do now.
• Full Source: | The complete source code | |
• Explanation: | Step-by-step code walking |