Newsgroups: alt.lang.design,comp.lang.c++,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!hudson.lm.com!netline-fddi.jpl.nasa.gov!elroy.jpl.nasa.gov!swrinde!ihnp4.ucsd.edu!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Comparing productivity: LisP against C++ (was Re: Reference Counting)
Message-ID: <9500414.17415@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU
Organization: Computer Science, University of Melbourne, Australia
References: <19941203T221402Z.enag@naggum.no> <3danhm$fqi@xmission.xmission.com> <3dc3ur$fsc@wariat.wariat.org> <3dd145$gnl@xmission <19950102.025457.841098.NETNEWS@UICVM.UIC.EDU>
Date: Wed, 4 Jan 1995 03:48:29 GMT
Lines: 39
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:105770 comp.lang.lisp:16258

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.

>: Languages such as Pascal and Ada which do distinguish them are just as
>: efficient for those sort of operations.
>
>        You are, quite simply, wrong.
>
>// safety tests left out out for brevity.
>cout << "Enter the page of the phone book you want to access." << endl;
>cin >> c;
>PhonePageArray[ c - 'A' ]->Access();

So you think this is going to be less efficient that the Ada or Pascal
equivalent?  Go and run some benchmarks.  Compare GNU C and GNU Ada,
for example.

>        There are hundreds more examples.

I'm pretty sure that you will find that for all of these sort of
examples, the equivalent in Ada is just as efficient as the C.

-- 
Fergus Henderson - fjh@munta.cs.mu.oz.au
