From: David Bakhash
Subject: what should replace the old `int-char' fn?
Date: 
Message-ID: <wk4spq3hzc.fsf@mit.edu>
I noticed that a function I use called int-char is deprecated.  So what
should I use in it's place, to solve a similar problem?

specifically, I'd like to create a table of all the characters that tend
to come up in ASCII documents, e.g. alpha-numerics (both cases),
punctuation, etc.  I was using a loop + (int-char i) to get them.  Now
what?

dave

From: Christopher R. Barry
Subject: Re: what should replace the old `int-char' fn?
Date: 
Message-ID: <87zp7ihavd.fsf@2xtreme.net>
David Bakhash <·····@mit.edu> writes:

> I noticed that a function I use called int-char is deprecated.  So what
> should I use in it's place, to solve a similar problem?
> 
> specifically, I'd like to create a table of all the characters that tend
> to come up in ASCII documents, e.g. alpha-numerics (both cases),
> punctuation, etc.  I was using a loop + (int-char i) to get them.  Now
> what?
> 
> dave

Not sure what you need this table for, but use C or something else to
print out a listing of all the ASCII character codes, then implement a
lookup table in Lisp (a hash table would probably be better than a
plist in this case, but I may be mistaken).

Christopher
From: Kent M Pitman
Subject: Re: what should replace the old `int-char' fn?
Date: 
Message-ID: <sfwbtjymwvf.fsf@world.std.com>
David Bakhash <·····@mit.edu> writes:

> 
> I noticed that a function I use called int-char is deprecated.  So what
> should I use in it's place, to solve a similar problem?

Something appropriate to the character set.  There is no unique
mapping from an integer to a character unless you know the character
set.  Consider ebcdic vs ascii to see the problem, since some
people are confused by the subset relation of ascii to unicode.
 
> specifically, I'd like to create a table of all the characters that tend
> to come up in ASCII documents, e.g. alpha-numerics (both cases),
> punctuation, etc.  I was using a loop + (int-char i) to get them.  Now
> what?

In practice, probably you can use code-char.

Though you'd be well-advised if you really think it's ASCII to make
yourself a library that has an ASCII table and just always use that.
CL has no special understanding of ASCII.  There are potentially CL
implementations that don't use ASCII.

int-char is a bigger hammer and not what you wanted anyway.
Your question implies you don't understand what int-char was
for but it does a lot more than encode the information
you're thinking it does.  If there are two loaded charsets,
int-char assigns unique indexes to all characters, so it's
impossible in that case for int-char to return the index in
the char set you want reliably.  char-code returns an index
within a char set, which is what you want.  This is probably
overly cryptic but I'm on my way out to dinner and if it's
confusing, I'm sure barry or erik will be happy to explain
rather than bicker..
From: Erik Naggum
Subject: Re: what should replace the old `int-char' fn?
Date: 
Message-ID: <3125571018264293@naggum.no>
* David Bakhash <·····@mit.edu>
| I noticed that a function I use called int-char is deprecated.  So what
| should I use in it's place, to solve a similar problem?

  CODE-CHAR.  it's the inverse of CHAR-CODE, which returns the same value
  as CHAR-INT in the absence of implementation-defined attributes (fonts,
  modifiers).

| specifically, I'd like to create a table of all the characters that tend
| to come up in ASCII documents, e.g. alpha-numerics (both cases),
| punctuation, etc.  I was using a loop + (int-char i) to get them.  Now
| what?

  readtables and the like contain vectors of CHAR-CODE-LIMIT length and
  look up stuff directly based on the CHAR-CODE of the character.

  (note: Allegro CL has a confusing value of CHAR-CODE-LIMIT because of an
  "international" version (Japanese, really, just as "international" as
  MULE in Emacs) that uses 16-bit character codes internally.  the real
  limit is EXCL:REAL-CHAR-CODE-LIMIT.)

#:Erik
-- 
  SIGTHTBABW: a signal sent from Unix to its programmers at random
  intervals to make them remember that There Has To Be A Better Way.