🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #200

Re: Re: Unintuitive semantics for initializing in for statements

#200
From: KW Heuer
Date: Mon, 19 May 1986 16:19
20 lines
1493 bytes
In article <652@baylor.UUCP> baylor!peter (Peter da Silva) writes:
[bentley!kwh writes:]
>>In C++, it's not so bad having statements which are not expressions, because
>>you can just make a one-statement inline function and use "return".
>
>How about going back to BCPL and allow *any* block to have a value that is
>returned by "return" (or use the BCPL keyword "resultis")?

I think it's obvious why you couldn't use "return".  As for the BCPL-style
"valof ... resultis", I think the inline function is a simpler concept (and
it looks cleaner besides).

>I have a question about C++: what is "cout << value"? I presume that's
>supposed to print the value in an appropriate format, but I can't figure
>why "cout". Why not "print value..."?

It isn't a builtin.  "cout" and this interpretation of "<<" are defined in
"stream.h".  "cout" corresponds to "stdout"; you can have other streams.

Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint
Technical Details
Message-ID: <839@bentley.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!lll-crg!topaz!bentley!kwh
References: <652@baylor.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!lll-crg!topaz!bentley!kwh
From: kwh@bentley.UUCP (KW Heuer)
Newsgroups: net.lang.c++
Subject: Re: Re: Unintuitive semantics for initializing in for statements
Message-ID: <839@bentley.UUCP>
Date: Mon, 19-May-86 12:19:08 EDT
Article-I.D.: bentley.839
Posted: Mon May 19 12:19:08 1986
Date-Received: Tue, 20-May-86 07:52:43 EDT
References: <652@baylor.UUCP>
Organization: AT&T Bell Laboratories, Liberty Corner
Lines: 20