From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!129.240.148.23!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Determining whitespace Date: 12 Oct 2002 22:32:11 +0000 Organization: Naggum Software, Oslo, Norway Lines: 26 Message-ID: <3243450731199834@naggum.no> References: <3243432163983480@naggum.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: maud.ifi.uio.no 1034461931 29567 129.240.65.5 (12 Oct 2002 22:32:11 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 12 Oct 2002 22:32:11 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:43801 * 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.