From: Ciaran Foley
Subject: String functions
Date: 
Message-ID: <9311091637.aa12042@Bonnie.ics.uci.edu>
If one wishes to check whether or not a character passed in from the
keyboard is of type punctuation, letter or number, are there
predefined functions that allow one to compare that single character
to the subset of punc, let, or nums? or do I have to define an entire
list of (alphabetic characters) (numbers) and (puncs) and check to see
whether or not the character that was passed in is a member of the
specific subset that I wish to test for?. I realize this is probably
an elementary question, but I'd be endebted to anyone who may be able
to help me. Currently I'm writing this program in Common lisp.

Thanks very much,
Ciaran Foley



........ . . . . . .  .  .  .  .   .    .    .      .        .
ciaran foley                           7 1 4 / 8 3 0 - 3 5 7 9
······@bonnie.ics.uci.edu                                pager
information & computer science                           voice
university of california at irvine                        data
........ . . . . . .  .  .  .  .   .    .    .      .      fax
From: Barry Margolin
Subject: Re: String functions
Date: 
Message-ID: <2br8o8INNrac@early-bird.think.com>
In article <··················@Bonnie.ics.uci.edu> ······@Bonnie.ICS.UCI.EDU (Ciaran Foley) writes:
>If one wishes to check whether or not a character passed in from the
>keyboard is of type punctuation, letter or number, are there
>predefined functions that allow one to compare that single character
>to the subset of punc, let, or nums?

ALPHA-CHAR-P, DIGIT-CHAR-P, ALPHANUMERICP, GRAPHIC-CHAR-P are the
predicates you can use.  You can define PUNCTUATION-CHAR-P in terms of
them:

(defun punctuation-char-p (char)
  (and (graphic-char-p char)
       (not (alphanumericp char))))
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar