Книга: Practical Common Lisp
Defining a Package
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:
(defpackage :com.gigamonkeys.id3v2
(:use :common-lisp
:com.gigamonkeys.binary-data
:com.gigamonkeys.pathnames)
(:export
:read-id3
:mp3-p
:id3-p
:album
:composer
:genre
:encoding-program
:artist
:part-of-set
:track
:song
:year
:size
:translated-genre))
As usual, you can, and probably should, change the com.gigamonkeys
part of the package name to your own domain.
- Structure of an ID3v2 Tag
- Defining a Package
- Integer Types
- String Types
- ID3 Tag Header
- ID3 Frames
- Detecting Tag Padding
- Supporting Multiple Versions of ID3
- Versioned Frame Base Classes
- Versioned Concrete Frame Classes
- What Frames Do You Actually Need?
- Text Information Frames
- Comment Frames
- Extracting Information from an ID3 Tag
- Defining a Class
- String package
- 21. Programming in the Large: Packages and Symbols
- 25. Practical: An ID3 Parser
- Defining Your Own Packages
- Packaging Reusable Libraries
- Fedora FTP Server Packages
- Starting the Very Secure FTP Server (vsftpd) Package
- Using yum to Remove Packages
- Using yum to Manage Package Inventory