[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: character objects & representation issues
- To: RWK at MIT-MC
- Subject: Re: character objects & representation issues
- From: Alan Bawden <ALAN at MIT-MC>
- Date: Fri ,15 Aug 80 16:13:00 EDT
- Cc: LISP-FORUM at MIT-MC
Date: 14 August 1980 23:18-EDT
From: Robert W. Kerns <RWK at MIT-MC>
Transportability aside, there are good CODING STYLE arguments
for character objects. It is damned useful to know by inspection
of the code that the 'fixnum' being handled is in reality A
REPRESENTATION OF A CHARACTER!
Indeed, one of the reasons for "#/" is to flag those fixnums that are
being used as representations of characters. This is a "good CODING
STYLE argument" for "#/", not for character objects.
Even better, if your program is writing a file to be read on
another machine, it is nice if PRINT knows they are characters! A
character is not JUST a fixnum. A fixnum can REPRESENT a
character, but it does not have the IDENTITY of a character.
I frequently use lists to REPRESENT things. The lists usually don't
have the IDENTITY of the things they represent (I don't know exactly
what this means anyway), and they print as lists too, but this isn't
an inconvenience. And there is this bonus that I can use these
functions named CAR and CDR and RPLACA to examine and modify them!
Amazing isn't it, without adding a single new data-type or function to
the language I can talk about new things!
Of course it is true that PRINTing something from MacLisp and then
READing it into some other machine (even a LispMachine) can produce
problems with your character set. But this is an amazingly rare
occurence, and involves other problems as well... (are #\lambda,
#\backspace and #/H all going to be diffent (non-EQ) character
objects? On the LispMachine they are all different, and the last one
isn't really a full-fledged character.)