Subject: Re: Pretty printing IP addresses
From: Erik Naggum <erik@naggum.no>
Date: 23 Sep 2002 20:22:06 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3241801326332982@naggum.no>

* Matthew X. Economou
| I'm writing some code that manipulates IP addresses.

  A class wrapper around a one-element vector specialized to contain 32-bit
  integers seems like a good choice.  Provide readers and setters that return
  and accept (respectively) a string, an integer, and four bytes.

| I would like to give the IP address object a pretty-printable and readable
| representation.

  Simple and easy with a class wrapper.

| Currently, I'm using a DEFTYPE declaration of (SIMPLE-BIT-VECTOR 32)

  Why on earth?  The overhead of constructing and deconstructing it bit by bit
  must be enormous.

| Is there a better way?

  See `print-object´.  Specialize methods on it for your wrapper class.

-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.