Exercise: A Free-Form Memo Pad
Now that you have an easy way to keep data on the disk, it's time to put it to good use. This exercise presents a free-form memo pad that keeps information based on keys and allows you to search and retrieve that information with simple queries.
A sample session with the program (called memopad) is shown in Listing 15.1.
To query the memopad program, simply type the name of a topic, followed by a question mark. To program in a new fact, type a phrase in the form “X is Y”, where X is the topic and Y is the information to associate with that topic. You can search the database for similarities by typing “like pattern?” where pattern is a regular expression to search for in the topics. All topics matching that expression ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access