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


Groups > comp.compilers > #426

Re: programming in PL/I

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end
From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: programming in PL/I
Date Sun, 15 Jan 2012 11:36:56 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 41
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <12-01-027@comp.compilers> (permalink)
References <12-01-009@comp.compilers> <12-01-010@comp.compilers> <12-01-013@comp.compilers> <12-01-017@comp.compilers> <12-01-020@comp.compilers> <12-01-023@comp.compilers>
NNTP-Posting-Host news.iecc.com
X-Trace leila.iecc.com 1326692563 34512 64.57.183.58 (16 Jan 2012 05:42:43 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Mon, 16 Jan 2012 05:42:43 +0000 (UTC)
Keywords PL/I, design, comment
Posted-Date 16 Jan 2012 00:42:43 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref x330-a1.tempe.blueboxinc.net comp.compilers:426

Show key headers only | View raw


glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:

(snip, I wrote)
> I do remember Picture format and Picture variables, though maybe I
> never tried them. I liked the idea of picture format, but thought that
> picture variables were strange.

(snip)
> [Those came straight from Cobol.  For what they're intended for, printing tidy
> columns of numbers in reports, they work very well. -John]

Hopefully discussions on internal data representation by compilers
aren't too far off topic.

As I understood it, picture variables stored the value as a text
representation, what IBM calls unpacked decimal. I still have not run
even one COBOL program, though recently I was scanning some COBOL
manuals to send to bitsavers.

You can write tidy columns with Fortran FORMAT, but you don't get so
much choice in how they come out. There is currently a discussion in
comp.lang.fortran on optional leading zeros that the standard allows,
(or allowed in older versions of the standard) and that different
compilers implement differently.

Picture allows you to specify, for example, exactly how many leading
zeros you want. C allows for zero padding or blank padding, but
nothing in between. (And I don't remember what it does for leading
zeros with %f format.)

-- glen
[I'm way ahead of you, I wrote one program in Cobol, but a lot of
programs in PL/I.  Picture variables specify the display format and
computational behavior of variables, not the internal representation.
IBM's implementation, the one I know the best, has a USAGE keyword
that lets you tell it what representation to use, e.g. USAGE
PACKED-DECIMAL.  Pictures are a lot more powerful than Fortran
formats, since they can insert commas, CR and DB codes, and the
like.  There is also surprisingly modern stuff like REDEFINES
to get the effect of unions in C, and SYNCHRONIZED to do
alignment padding in structures and arrays. -John]

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


Thread

Re: Parser generator drb@msu.edu (Dennis Boone) - 2012-01-08 11:47 -0600
  Re: Parser generator glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-08 21:58 +0000
    Re: Parser generator arnold@skeeve.com (Aharon Robbins) - 2012-01-11 20:06 +0000
      Re: PL/I, was Parser generator drb@ihatespam.msu.edu (Dennis Boone) - 2012-01-11 16:19 -0600
      Re: PL/I, was Parser generator Robert AH Prins <robert@prino.org> - 2012-01-11 23:42 +0000
      Re: programming in PL/I compilers@is-not-my.name - 2012-01-12 16:30 +0000
        Re: programming in PL/I Robert AH Prins <robert@prino.org> - 2012-01-14 09:20 +0000
        Re: programming in PL/I "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2012-01-14 14:08 +0000
          Re: programming in PL/I glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-15 01:01 +0000
            Re: programming in PL/I glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-15 11:36 +0000
    Re: Parser generator for PL/I "robin" <robin51@dodo.com.au> - 2012-01-15 02:00 +1100
      Re: Parser generator for PL/I drb@ihatespam.msu.edu (Dennis Boone) - 2012-01-14 23:40 -0600
  Re: Parser generator SLK Systems <slkpg3@gmail.com> - 2012-01-08 20:26 -0500
    Re: Parser generator glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 07:22 +0000
      Re: Parser generator SLK Systems <slkpg3@gmail.com> - 2012-01-11 20:28 -0500

csiph-web