Defining a Package

Like the other libraries you’ve developed so far, the code you’ll write in this chapter is worth putting in its own package. You’ll need to refer to functions from both the binary data and pathname libraries developed in Chapters 24 and 15 and will also want to export the names of the functions that make up the public API to this package. The following package definition does all that:

  1. (defpackage :com.gigamonkeys.id3v2
  2. (:use :common-lisp
  3. :com.gigamonkeys.binary-data
  4. :com.gigamonkeys.pathnames)
  5. (:export
  6. :read-id3
  7. :mp3-p
  8. :id3-p
  9. :album
  10. :composer
  11. :genre
  12. :encoding-program
  13. :artist
  14. :part-of-set
  15. :track
  16. :song
  17. :year
  18. :size
  19. :translated-genre))

As usual, you can, and probably should, change the com.gigamonkeys part of the package name to your own domain.