Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #68682

Re: fprintf with /r/n outputs only one line

From Bartc <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: fprintf with /r/n outputs only one line
Date 2015-08-30 13:22 +0100
Organization A noiseless patient Spider
Message-ID <mruses$f6s$1@dont-email.me> (permalink)
References (8 earlier) <call-line-20150829221628@ram.dialup.fu-berlin.de> <mrt95e$p2q$1@dont-email.me> <d754f5f3-9d9d-4b3d-861e-d5c3d0cabbc6@googlegroups.com> <mrtfa5$gfe$1@dont-email.me> <effect-function-20150830004413@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 30/08/2015 00:46, Stefan Ram wrote:
> Bartc <bc@freeuk.com> writes:
>> But in C especially, people prefer that even procedures return some sort
>> of value, perhaps a status. With the consequence that some try to cram
>> several such calls into a single expression.
>
>    The distinction between functions and procedures is used,
>    for example, in Pascal.
>
>    In C, there are only functions, but we are still using the
>    Pascal notions.
>
>    Pascal was intended for teaching, and indeed for students,
>    the distinction between functions and procedures is helpful.

You get distinct functions and procedures in Ada as well, and other 
languages that haven't been touched by C syntax and idea. Ada is not a 
teaching language and has been well designed, so there must have been a 
good reason for it.

Everywhere that you have:

   a;
   b;
   c;

and want to collect all those statements into a single routine, then 
you're creating a procedure, not a function.

(I can understand that some languages delight in unifying different 
concepts, so that for example everything has a value; Algol68 for one, 
where you need to use 'void' a lot whenever something doesn't fall into 
that pattern. In real programming it's a bit different.)

-- 
Bartc

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

fprintf with /r/n outputs only one line Dale <dale@dalekelly.org> - 2015-08-28 23:08 -0400
  Re: fprintf with /r/n outputs only one line Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-08-28 21:25 -0600
    Re: fprintf with /r/n outputs only one line Dale <dale@dalekelly.org> - 2015-08-28 23:56 -0400
  Re: fprintf with /r/n outputs only one line James Kuyper <jameskuyper@verizon.net> - 2015-08-28 23:34 -0400
    Re: fprintf with /r/n outputs only one line Dale <dale@dalekelly.org> - 2015-08-29 00:02 -0400
      Re: fprintf with /r/n outputs only one line Johann Klammer <klammerj@NOSPAM.a1.net> - 2015-08-29 06:51 +0200
        Re: fprintf with /r/n outputs only one line Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-08-29 07:30 +0000
        Re: fprintf with /r/n outputs only one line Keith Thompson <kst-u@mib.org> - 2015-08-29 01:23 -0700
      Re: fprintf with /r/n outputs only one line James Kuyper <jameskuyper@verizon.net> - 2015-08-29 11:22 -0400
        Re: fprintf with /r/n outputs only one line glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-29 16:59 +0000
      Re: fprintf with /r/n outputs only one line Geoff <geoff@invalid.invalid> - 2015-08-30 11:40 -0700
        Re: fprintf with /r/n outputs only one line Keith Thompson <kst-u@mib.org> - 2015-08-30 15:17 -0700
          Re: fprintf with /r/n outputs only one line Geoff <geoff@invalid.invalid> - 2015-08-30 16:21 -0700
            Re: fprintf with /r/n outputs only one line James Kuyper <jameskuyper@verizon.net> - 2015-08-30 19:45 -0400
  Re: fprintf with /r/n outputs only one line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-29 14:51 +0100
    Re: fprintf with /r/n outputs only one line Ayan <selfjam@gmail.com> - 2015-08-29 10:24 -0400
      Re: fprintf with /r/n outputs only one line James Kuyper <jameskuyper@verizon.net> - 2015-08-29 11:27 -0400
      Re: fprintf with /r/n outputs only one line Ayan <selfjam@gmail.com> - 2015-08-29 14:31 -0400
      Re: fprintf with /r/n outputs only one line Keith Thompson <kst-u@mib.org> - 2015-08-29 13:31 -0700
    Re: fprintf with /r/n outputs only one line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-29 16:03 +0100
      Re: fprintf with /r/n outputs only one line Ike Naar <ike@iceland.freeshell.org> - 2015-08-29 16:50 +0000
        Re: fprintf with /r/n outputs only one line Ike Naar <ike@iceland.freeshell.org> - 2015-08-29 17:05 +0000
          Re: fprintf with /r/n outputs only one line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-29 19:39 +0100
            Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-29 14:05 -0700
              Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-29 22:46 +0100
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-29 15:59 -0700
                Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-30 00:31 +0100
                Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-30 10:25 +0100
                Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-30 13:22 +0100
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 03:18 -0700
                Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-31 11:58 +0100
                Re: fprintf with /r/n outputs only one line Bartc <bc@freeuk.com> - 2015-08-31 13:38 +0100
                Re: fprintf with /r/n outputs only one line glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-04 04:18 +0000
                Re: fprintf with /r/n outputs only one line "Charles Richmond" <numerist@aquaporin4.com> - 2015-09-04 05:09 -0500
                Re: fprintf with /r/n outputs only one line Robert Wessel <robertwessel2@yahoo.com> - 2015-09-04 05:19 -0500
                Re: fprintf with /r/n outputs only one line raltbos@xs4all.nl (Richard Bos) - 2015-09-04 16:33 +0000
              Re: fprintf with /r/n outputs only one line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-30 02:17 +0100
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-29 23:43 -0700
                Re: fprintf with /r/n outputs only one line Geoff <geoff@invalid.invalid> - 2015-08-30 11:47 -0700
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-30 13:18 -0700
                Re: fprintf with /r/n outputs only one line Geoff <geoff@invalid.invalid> - 2015-08-30 16:04 -0700
              Re: fprintf with /r/n outputs only one line Ike Naar <ike@iceland.freeshell.org> - 2015-08-30 07:20 +0000
              Re: fprintf with /r/n outputs only one line Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 15:17 -0700
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-06 16:36 -0700
                Re: fprintf with /r/n outputs only one line Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-07 23:19 -0700
                Re: fprintf with /r/n outputs only one line Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-08 02:50 -0700
            Re: fprintf with /r/n outputs only one line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-30 02:14 +0100

csiph-web