Subject: Re: Determining whitespace From: Erik Naggum <erik@naggum.no> Date: 12 Oct 2002 22:32:11 +0000 Newsgroups: comp.lang.lisp Message-ID: <3243450731199834@naggum.no> * Matthew X. Economou | I'm writing a library function that parses an IP address embedded in a | string. Since an IP address may be several different things, I think the function should be separated into two parts: one that searches for an IP address (however defined: IPv4, IPv6, abbreviated or full), and several functions that accept whatever passes for IP addresses and return the appropriate address structure. I have found that I need CIDR coding with both /n and /mask, but in other cases, /port is used. Sometimes, even .port is used (which does not work with abbreviated IP addresses), although I consider the smartest choice to be :port with IPv4 and /port with IPv6. When you make this separation of functionality, there should be no need to know what the whitespace characters are. Actually processing everything that people do with IP addresses is fascinatingly complex. Many losers have no concern for parsability of the output from their programs. *sigh* Surprisingly often, wanting to know if you look at a whitespace character means that you have chosen a less-than-ideal approach to the solution. If you parse using a stream, `peek-char´ has a skip-whitespace option. -- 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.