[comp.lang.c] comment token mistake

maart@cs.vu.nl (Maarten Litmaath) (04/29/89)

The choice of the 2-token sequence `/*' for starting a comment, was a mistake:

	printf("%d\n", *a/*b);

Why didn't dmr take an otherwise illegal token, e.g. `@'?

PS: `//' will fail too - think about it!
-- 
 "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
  it's probably wrong." (jim@bilpin). |maart@cs.vu.nl, mcvax!botter!maart

jas@ernie.Berkeley.EDU (Jim Shankland) (04/30/89)

In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>The choice of the 2-token sequence `/*' for starting a comment, was a mistake:
>
>	printf("%d\n", *a/*b);
>
>Why didn't dmr take an otherwise illegal token, e.g. `@'?

Perhaps to force people to put at least a minimal amount of white space
into their code!

Jim Shankland
jas@ernie.berkeley.edu

"Blame it on the lies that killed us, blame it on the truth that ran us down"

bph@buengc.BU.EDU (Blair P. Houghton) (04/30/89)

In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>The choice of the 2-token sequence `/*' for starting a comment, was a mistake:
>
>	printf("%d\n", *a/*b);
>

Maarten...%-/...

Bait?  From you?

Acshully, and I'm certain this is going to balloon into the biggest
silly-thread in comp.lang.c this year, I often wonder what the trugurus
were thinking when they chose something so odd to be a comment-delimiter.

I mean, the "big-C in column one" of Fortran makes more sense, viscerally,
if (certainly) not lexically.

Perhaps it was just theirs-by-fiat, having fallen from an earlier
incarnation of the language ("B", "C--", I dunno.), or perhaps it was
a sarcastic comment (PUN!!) on the `(*' stuff that Pascal was shedding.

Personally, I'm waiting for a language that recognizes its own syntax
easily enough to avoid parsing comments, delimiters or no.

				--Blair
				  "Where's my lollipop?"

robert@arizona.edu (Robert J. Drabek) (04/30/89)

In article <2423@solo5.cs.vu.nl>, maart@cs.vu.nl (Maarten Litmaath) writes:
> The choice of the 2-token sequence `/*' for starting a comment,
> was a mistake:
> 
> 	printf("%d\n", *a/*b);
>                      ^^^^^
>  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
>  "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
>   it's probably wrong." (jim@bilpin). |maart@cs.vu.nl, mcvax!botter!maart

Your own signature easily addresses the point.  Since it is aesthetically
unpleasing to cram the three tokens together (youdon'tlikethis,doyou?),
you got what you deserved.

(So why do I even bother reading through this group?  Why do some
schools even allow students to post outside of their own buildings?)
-- 
Robert J. Drabek
Department of Computer Science
The University of Arizona
Tucson, AZ  85721

gwyn@smoke.BRL.MIL (Doug Gwyn) (05/01/89)

In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>	printf("%d\n", *a/*b);
>Why didn't dmr take an otherwise illegal token, e.g. `@'?

Maybe he thought that people who don't use white space deserve to
be punished.

trebor@biar.UUCP (Robert J Woodhead) (05/01/89)

In article <10179@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
>In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>>	printf("%d\n", *a/*b);
>>Why didn't dmr take an otherwise illegal token, e.g. `@'?
>Maybe he thought that people who don't use white space deserve to
>be punished.

Actually, dmr could have solved the whole problem by simply defining /* as
the ``Comment Operator'', and assigning it the highest possible precedence.
In this way, ``no white space scum'' (as we affectionately refer to them),
who, as we all know, read a page or two of K&R every night before bedtime
(and wish it was in every motel room in America), would never run into this
vexing problem.

;^)

-- 
Robert J Woodhead, Biar Games, Inc.  ...!uunet!biar!trebor | trebor@biar.UUCP
"The NY Times is read by the people who run the country.  The Washington Post
is read by the people who think they run the country.   The National Enquirer
is read by the people who think Elvis is alive and running the country..."

dg@lakart.UUCP (David Goodenough) (05/01/89)

From article <2423@solo5.cs.vu.nl>, by maart@cs.vu.nl (Maarten Litmaath):
> The choice of the 2-token sequence `/*' for starting a comment, was a mistake:
> 
> 	printf("%d\n", *a/*b);
> 
> -- 
>  "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   it's probably wrong." (jim@bilpin). |maart@cs.vu.nl, mcvax!botter!maart
    ^^^^^^^^^^^^^^^^^^^^^

The signature quote says it all. Try:

 	printf("%d\n", *a / *b);

Which I for one find infinitely more readable.
-- 
	dg@lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp@xait.xerox.com		  	  +---+

byrum@cs.odu.edu (Terry Franklin Byrum) (05/01/89)

In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
> The choice of the 2-token sequence `/*' for starting a comment, was a mistake:
>
>	printf("%d\n", *a/*b);
>

	Looks like bad code to me.  Don't you mean it is the mistake of the
person who doesn't use white spaces.  

> "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
>  it's probably wrong." (jim@bilpin). |maart@cs.vu.nl, mcvax!botter!maart

       Your signature says it all!


-- 
Frank Byrum, BROOKS Financial Systems, Suffolk VA, (804)539-7202  1st Law of SE
INET:byrum@cs.odu.edu UUCP:..!uunet!cs.odu.edu!byrum          Semper Sic Factum

guy@auspex.auspex.com (Guy Harris) (05/02/89)

>Perhaps it was just theirs-by-fiat, having fallen from an earlier
>incarnation of the language ("B", "C--", I dunno.), or perhaps it was
>a sarcastic comment (PUN!!) on the `(*' stuff that Pascal was shedding.

Or maybe they just picked it up from PL/I.

diamond@diamond.csl.sony.junet (Norman Diamond) (05/02/89)

In article <2423@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:

>>	printf("%d\n", *a/*b);
>>Why didn't dmr take an otherwise illegal token, e.g. `@'?

In article <10179@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:

>Maybe he thought that people who don't use white space deserve to
>be punished.

That can't be the reason.  If it were the reason, then

    a =- b;

would not have been fixed.  (Just like the ambiguous a+++b has not
been fixed, and the unambiguous a+++++b has not been fixed.)

Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net)
  The above opinions are my own.   |  Why are programmers criticized for
  If they're also your opinions,   |  re-inventing the wheel, when car
  you're infringing my copyright.  |  manufacturers are praised for it?

mat@mole-end.UUCP (Mark A Terribile) (05/02/89)

>>The choice of the 2-token sequence `/*' for starting a comment was a mistake:

> >	printf("%d\n", *a/*b);

> ... I often wonder what the trugurus were thinking when they chose something
> so odd to be a comment-delimiter.

> I mean, the "big-C in column one" of Fortran makes more sense, viscerally,
> if (certainly) not lexically.
 
> Perhaps it [came] from an earlier incarnation of the language ("B", ...)
> or perhaps it was a sarcastic comment [on Pascal's `(*']

It came, I believe, from an earlier language which a few people on the net
may have heard of.  It was called PL/I and it was created, I believe, by some
outfit called the Icky Blue Machine Company.  They had this notion that they
could mix FORTRAN and COBOL and get something useful out of it.  C's struct
and the notation for structs and pointer-to-struct came (I believe) from it;
fortunately C uses nested control structures and avoids the use of labels
for program unit delimiters.

(Actually, PL/I did a remarkable number of things right, and even more almost
right.  It's too bad they couldn't stop with the things they did right, that's
all.)

The PL/I comment convention didn't cause white-space-significance in PL/I
because PL/I lacks the exceptionally rich, token-overloaded operator set of
C.

The PL/I convention is certainly better than FORTRAN's because you can put
comments to the right of data items.  I hope that few would argue that it's
better than COBOL's.  Whether C deserved something better is another question.


			Down with PROC OPTIONS MAIN !
-- 

(This man's opinions are his own.)
From mole-end				Mark Terribile

bph@buengc.BU.EDU (Blair P. Houghton) (05/02/89)

In article <1521@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>Perhaps it was just theirs-by-fiat, having fallen from an earlier
>>incarnation of the language ("B", "C--", I dunno.), or perhaps it was
>>a sarcastic comment (PUN!!) on the `(*' stuff that Pascal was shedding.
>
>Or maybe they just picked it up from PL/I.

Okay, okay, okay, okayokayokay  OOOKAAAYYY!!!

Yeah.  I remember now.  It was PL/I.  (sweat-shivver-grimace)...

				--Blair
				  /* I thought those dark days were
				     over... but now the forces of
				     evil return to batter my soul... */"

smryan@garth.UUCP (s m ryan) (05/04/89)

>> The choice of the 2-token sequence `/*' for starting a comment,
>> was a mistake:
>> 
>> 	printf("%d\n", *a/*b);
>>                      ^^^^^
>>  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
>>  "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
>>   it's probably wrong." (jim@bilpin). |maart@cs.vu.nl, mcvax!botter!maart
>
>Your own signature easily addresses the point.  Since it is aesthetically
>unpleasing to cram the three tokens together (youdon'tlikethis,doyou?),
>you got what you deserved.

Geez. Why design style rules into a language?

A little thought could have avoided this if instead of slavishly following
PL/I.

How many more decades will `a=*b;' be an old-fashioned operator?

>(So why do I even bother reading through this group?  Why do some
>schools even allow students to post outside of their own buildings?)
>-- 
>Department of Computer Science

Why do schools let anyone post? Why not just leave it to us professionals?
-- 
16. `The wealth I lose becomes the bane           Steven Ryan: ingr!garth!smryan
of all who own or seek in vain.                    2400 Geng Road, Palo Alto, CA
It brings but death to Hreithmar's kin     Here have some grub. O they very fine
and joy of wealth no man shall win.'     baby worms cooked in the holy corn oil.

gwyn@smoke.BRL.MIL (Doug Gwyn) (05/04/89)

In article <2806@garth.UUCP> smryan@garth.UUCP (s m ryan) writes:
>How many more decades will `a=*b;' be an old-fashioned operator?

Approximately -0.9 decades.

rob@phavl.UUCP (Robert Ransbottom) (05/06/89)

RE:  UPPER || lower || Who  &&
     Chars || Charred  &&
     '\n' || '}' || ';' || ";}" &&
     pound!=hash!=sharp!=number_sign
  

...because discussions of an ideal programming language using
C as a model (or a contrary) are not discussions about C;  however
they are highly provocative to most readers here.


-- 
 ...!uunet!phavl!rob              Robert Ransbottom

bill@twwells.uucp (T. William Wells) (05/06/89)

In article <2806@garth.UUCP> smryan@garth.UUCP (s m ryan) writes:
: Why do schools let anyone post? Why not just leave it to us professionals?

Because there is no necessary relation between having a degree and the
attribute of optical rectosis, as your posting demonstrates.

Followups to alt.flame.

---
Bill                            { uunet | novavax } !twwells!bill

mat@mole-end. and 0 (Mark A Terribile) (05/07/89)

>>The choice of the 2-token sequence `/*' for starting a comment was a mistake:

> >	printf("%d\n", *a/*b);

> ... I often wonder what the trugurus were thinking when they chose something
> so odd to be a comment-delimiter.

> I mean, the "big-C in column one" of Fortran makes more sense, viscerally,
> if (certainly) not lexically.
 
> Perhaps it [came] from an earlier incarnation of the language ("B", ...)
> or perhaps it was a sarcastic comment [on Pascal's `(*']

It came, I believe, from an earlier language which a few people on the net
may have heard of.  It was called PL/I and it was created, I believe, by some
outfit called the Icky Blue Machine Company.  They had this notion that they
could mix FORTRAN and COBOL and get something useful out of it.  C's struct
and the notation for structs and pointer-to-struct came (I believe) from it;
fortunately C uses nested control structures and avoids the use of labels
for program unit delimiters.

(Actually, PL/I did a remarkable number of things right, and even more almost
right.  It's too bad they couldn't stop with the things they did right, that's
all.)

The PL/I comment convention didn't cause white-space-significance in PL/I
because PL/I lacks the exceptionally rich, token-overloaded operator set of
C.

The PL/I convention is certainly better than FORTRAN's because you can put
comments to the right of data items.  I hope that few would argue that it's
better than COBOL's.  Whether C deserved something better is another question.


			Down with PROC OPTIONS MAIN !
-- 

(This man's opinions are his own.)
From mole-end				Mark Terribil