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


Groups > comp.programming > #1909

Re: commas

From blmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Newsgroups comp.programming
Subject Re: commas
Date 2012-07-06 19:01 +0000
Organization None
Message-ID <a5or09Ff9dU1@mid.individual.net> (permalink)
References <f0d3d247-8eac-4ce0-bb61-296a58ea2035@googlegroups.com> <4fdeb0e5$0$17207$892e0abb@auth.newsreader.octanews.com> <97dtt756jsdcgrjiufo8jlpb9e51djufdv@4ax.com>

Show all headers | View raw


In article <97dtt756jsdcgrjiufo8jlpb9e51djufdv@4ax.com>,
Robert Wessel  <robertwessel2@yahoo.com> wrote:
> On Sun, 17 Jun 2012 22:38:47 -0600, Thad Smith <ThadSmith@acm.org>
> wrote:
> 
> >On 6/12/2012 8:09 AM, bob wrote:
> >> Are there any languages where you can actually use commas in the numbers?
> >>
> >> So, instead of having to write:
> >>
> >> int x = 5000000;
> >>
> >> You could write:
> >>
> >> int x = 5,000,000;
> >>
> >> I think this could improve clarity a lot.
> >
> >I haven't used Fortran in decades, but my recollection is it allowed arbitrary 
> >spaces to be embedded in source.  If that is still the case, you could write
> >        x = 5 000 000

Quite belatedly, for the record maybe ....

That was true of old-style FORTRAN (standards up through FORTRAN 77).
Fortran 90 [*] introduced an alternate source format ("free form", as
opposed to the older "fixed form") with a lot fewer restrictions on
column alignment and so forth, and in this new format spaces *are*
significant.  In the new format the mistake described below wouldn't
be possible -- though neither would the above trick for making
numeric constants more readable.  The compilers I've used support
both formats, with the choice determined by either the filename
extension or a compiler switch.  (Backward compability, you know.)

Fortran these days -- if one can judge by comp.lang.fortran, it
continues to evolve and to have an active and enthusiastic user base,
but it's something of a niche language.

[*] Yeah, they also decided to drop the all-caps spelling.

> 
> Indeed, mistyping:
> 
>   DO 100 I = 1, 10
> 
> with a period instead of a comma, would result in:
> 
>   DO100I = 1.10
> 
> Which, of course, doesn't loop as intended, implicitly declares a
> variable called DO100I and assigns a value to it, and would typically
> not produce any sort of diagnostic.  And when you're debugging a paper
> listing, printed on low quality paper with a cheap, almost worn out,
> ribbon, that was not easy to spot.
> 

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

commas bob <bob@coolfone.comze.com> - 2012-06-12 07:09 -0700
  Re: commas Robert Wessel <robertwessel2@yahoo.com> - 2012-06-12 09:16 -0500
    Re: commas BGB <cr88192@hotmail.com> - 2012-06-12 09:53 -0500
    Re: commas "BartC" <bc@freeuk.com> - 2012-06-12 16:33 +0100
  Re: commas Paul Herber <paul@pherber.com> - 2012-06-12 15:37 +0100
    Re: commas Rui Maciel <rui.maciel@gmail.com> - 2012-06-12 16:14 +0100
  Re: commas "BartC" <bc@freeuk.com> - 2012-06-12 16:37 +0100
    Re: commas Rui Maciel <rui.maciel@gmail.com> - 2012-06-12 17:10 +0100
  Re: commas Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-12 09:32 -0700
    Re: commas Ben Pfaff <blp@cs.stanford.edu> - 2012-06-12 09:54 -0700
    Re: commas "BartC" <bc@freeuk.com> - 2012-06-12 18:05 +0100
      Re: commas Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-12 11:51 -0700
        Re: commas "BartC" <bc@freeuk.com> - 2012-06-12 20:36 +0100
          Re: commas Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-12 16:28 -0700
  Re: commas Thad Smith <ThadSmith@acm.org> - 2012-06-17 22:38 -0600
    Re: commas Robert Wessel <robertwessel2@yahoo.com> - 2012-06-18 00:02 -0500
      Re: commas blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2012-07-06 19:01 +0000
  Re: commas Jongware <jongware@no-spam.plz> - 2012-07-30 15:53 +0200
    Re: commas "BartC" <bc@freeuk.com> - 2012-07-30 15:50 +0100
      Re: commas "BartC" <bc@freeuk.com> - 2012-08-01 01:56 +0100
        Re: commas Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-01 03:31 +0100
    Re: commas rossum <rossum48@coldmail.com> - 2012-07-30 19:57 +0100
    Re: commas Fritz Wuehler <fritz@spamexpire-201207.rodent.frell.theremailer.net> - 2012-07-30 22:14 +0200
      Re: commas Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-30 23:00 +0100

csiph-web