Defining Tasks

Introduction

This small tool is useful for defining hierarchies of tasks, named by strings. For example, one might define a task "/project", which has subtasks "/project/lisp" and "/project/marketing". Clients (implemented here as strings, though these could be replaced with complex data) and values can be associated with tasks. Task hierarchies could be useful in applications such as time logging programs, spreadsheets, etc.

The actual task tool uses a more generic simple tree representation; if the programmer wished, this could for example also be used to define client hierarchies or hierachies of other data which could then be stored in the client or value slots of tasks.

Tree Representation

Trees are here implemented using structures; the detailed implementation of a tree is hidden behind a simple API, but essentially each node in the tree is a structure which contains a "children" slot which references all its child nodes. Nodes have names, which are strings, and values, which can be instances of any Lisp type.

Task Representation

Tasks are also implemented using structures. Each task is stored as the value of a node in the tree representation. Tasks, like tree nodes, have names. (Don't confuse the name of a task - which to the user of the task tool in some sense is the task - with the name of its node, which is used in the tree representation to reference that node.)

Tasks also have clients, implemented here as strings, and values - which can be instances of any Lisp type. Thus, in for example a time-logging application the value of a task might be an integer, representing the number of hours to be logged against that task, or it might be a more complex data type representing hours and minutes, and so on.

Task Interface

A simple API to the task tool is provided:

Naming tasks
Task names are strings, each of which uniquely identifies a task's place within the task hierarchy. For example, "/project/lisp/dynamic" might be a project within the Lisp group in a company which is developing material for the Dynamic Learning Center. The parts of a task name are separated by a task separation character, by default "/". This is defined as the value of the special variable *task-sep-char*. task-name returns the name of a task.
Task clients and values
task-client returns a task's client and task-value returns a task's value
Creating tasks
Tasks are created by name using a function called create-task, for example (create-task "/project/lisp" :client Franz).
Finding tasks
A task can be found by name using find-task.
Printing tasks
There are also a couple of basic utilities for printing out information about tasks. These have more options than are documented - useful for debugging.

Author: Gail Anderson (ga@cley.com), Cley Limited.
Copyright 1999–2003 Cley Ltd. & Franz Inc.