Newsgroups: alt.lang.design,comp.lang.c++,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!newsfeed.pitt.edu!uunet!mole-end!mat
From: mat@mole-end.matawan.nj.us
Subject: Re: Comparing productivity: LisP against C++ (was Re: Reference Counting)
Message-ID: <1995Jan6.044131.863@mole-end.matawan.nj.us>
Organization: :
References: <19941203T221402Z.enag@naggum.no> <3danhm$fqi@xmission.xmission.com> <9500414.17415@mulga.cs.mu.OZ.AU>
Date: Fri, 6 Jan 1995 04:41:31 GMT
Lines: 49
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:106115 comp.lang.lisp:16292

In article <9500414.17415@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
> dhanley@matisse.eecs.uic.edu (David Hanley) writes:
> 
> >Fergus Henderson (fjh@munta.cs.mu.OZ.AU) wrote:
> >: C's lack of type-checking in this regard - the failure to distinguish
> >: a character type from a small integer - does NOT make it any more efficient.
> >
> >        What ARE you talking about?  There _is_ type checking on chars;
> >try to substitute one for a short integer.  This is different from saying
> >that a character can be represented as a number, however.
> 
> What I am talking about is the category error involved in confusing
> characters and their ordinal values.  It quite simply does not make
> sense to "add" two characters together.  It _does_ make sense to add
> their values together.  C confuses the notion of character with the
> notion of a character's numerical value; it fails to distinguish
> between abstract value and representation, and allows operations on the
> abstract values which only make sense on the representations.

One can argue this.

In sober fact, it makes far less difference than you make it sound.  Most
`punned' chars are parts of larger data aggregates/layouts, and such things
are routinely documented.  In fact, in many programs, they are the ONLY
things that are documented.  And the better the encapsulation and the better
the locality of the code that actually uses the representation, the less it
matters.

Moreover, the term `ordinal value' is excessively highfalutin' abstract.
For most purposes (including the construction of hash tables and lookup
for is-alphabetic/is-numeric/is-punctuation tests) the `ordinal value' _is_
the integral value represented by the character's bit pattern.

Yes, it makes much sense to understand the distinctions.

No, it makes very little sense to erect enormous edifices to support
them, especially when the two levels are routinely hybridized in
programming, and at little harm.

The term `category error' is much overused, IMO.  In those cases where
someone really needs to hear what it tells, that listener probably doesn't
know its meaning; in those cases where the listener knows the meaning, it's
usually an exercise in a difference that makes no difference--a difference
that is not a distinction.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile
 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
	(Training and consulting in C, C++, UNIX, etc.)
