Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sun4nl!cwi.nl!olaf
From: olaf@cwi.nl (Olaf Weber)
Subject: Re: Comparing syntaxes  (Re: What language would you use?)
In-Reply-To: peter@nmti.com's message of Wed, 9 Nov 1994 22:01:42 GMT
Message-ID: <Cz24DC.2Hu@cwi.nl>
Followup-To: comp.lang.misc
Sender: news@cwi.nl (The Daily Dross)
Nntp-Posting-Host: havik.cwi.nl
Organization: CWI, Amsterdam
References: <39b7ha$j9v@zeno.nscf.org> <39mi58$aeu@brachio.zrz.tu-berlin.de>
	<id.33KE1.GY@nmti.com> <39pel5$qls@brachio.zrz.tu-berlin.de>
	<id.6ALE1.TW6@nmti.com>
Date: Thu, 10 Nov 1994 15:00:50 GMT
Lines: 55
Xref: glinda.oz.cs.cmu.edu comp.lang.python:2563 comp.lang.tcl:21655 comp.lang.scheme:11138 comp.lang.misc:19005 comp.lang.perl:38544

Lots of deletia below, and follow-ups restricted to comp.lang.misc.

In article <id.6ALE1.TW6@nmti.com>,
peter@nmti.com (Peter da Silva) writes:
> In article <39pel5$qls@brachio.zrz.tu-berlin.de>,
> Reimer Behrends <behrends@buran.fb10.tu-berlin.de> wrote:

>> If readability was a concern, the designers of C failed remarkably.

> In your opinion.

Which happens to be shared by many people, even if they've never seen
a line of C.  Personally, I think C could have been more readable in
some areas, but it isn't that bad.

>> And this is just a simple case. Check the section in K&R on
>> argc/argv processing for more details. And why does both char
>> *argv[] and char **argv work, but not char argv[][]?

> Because a pointer isn't an array. If you think of a pointer as an
> array you'll lose.

Unfortunately this kind of thinking is encouraged by C's habit of
interpreting array names as pointers in some contexts.

>> Imagine the subtle difference between void *f() and void (*f)(). Etc.

> I haven't seen a *better* declaration syntax than C's for complex
> declarations. Making * a prefix rather than a postfix operator was a
> mistake, yes. I'll grant you that one. Given the lack of prior art,
> I can't ding them too hard for that.

But there was prior art.  In ALGOL 68 you'd have `PROC REF VOID f'
versus `REF PROC VOID f', although the latter would have been `PROC
VOID f' for most uses.  I find the ALGOL 68 system more readable than
the C version.  Compare C's
	void (*signal(int sig, void (*func)(int)))(int);
with the algoloid
	proc(int sig, proc(int) void func) proc(int) void signal;
and the Pascaloid
	func signal(sig: int; proc func(int)): proc(int);
to see which one seems the best in this case.

>> o There are way too many precedence levels in C.

> I'll buy this one.

I'm not sure I do.  You could remove some of them (perhaps also drop
some operators?), but having more levels than are offered by Pascal is
certainly convenient.

So, how many precedence levels would you like to have, and how would
you group the operators?

-- Olaf Weber
