Re: VMS Pascal article

Liste des GroupesRevenir à co vms 
Sujet : Re: VMS Pascal article
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : comp.os.vms
Date : 03. Jan 2025, 22:24:09
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <vl9khp$cdg$1@reader2.panix.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <6778415e$0$708$14726298@news.sunsite.dk>,
Arne Vajhøj  <arne@vajhoej.dk> wrote:
On 1/3/2025 1:51 PM, Dan Cross wrote:
In article <vl9aln$o72$1@dont-email.me>, Arne Vajhøj  <arne@vajhoej.dk> wrote:
On 1/3/2025 1:17 PM, Dan Cross wrote:
In article <67781447$0$711$14726298@news.sunsite.dk>,
And also fixed in the description of VARYING further up.
>
You should seriously mention the STRING type, though.
>
I think VARYING OF CHAR is what is used most in VMS Pascal.
 
Weird; I can't imagine why.
>
I never use string (on VMS).
>
$ search sys$common:[syshlp.examples.pascal]*.pas varying
$ search sys$common:[syshlp.examples.pascal]*.pas "string("
>
indicate that whoever write VMS Pascal examples also prefer
varying of char over string.
>
If I were to guess about why, then I believe it is historic
reasons. varying of char has been there since like forever.
string was added with ISO Pascal support later.

I suspect that's close, but ISO Pascal doesn't have a 'VARYING'
array type, either.

I suspect you're referring to what ISO calls "Extended Pascal"
(ISO 10206); ISO Pascal (ISO 7185) doesn't support a `String`
type of either the VSI Pascal form or the Turbo
Pascal/Delphi/FreePascal form, only manifest string literals and
`packed array [1..n] of char`.  Of course, one can define a type
alias, and ISO 7185 says this:

|Any type designated packed and denoted by an array-type having
|as its index-type a denotation of a subrange-type specifying a
|smallest value of 1 and a largest value of greater than 1, and
|having as its component-type a denotation of the char-type,
|shall be designated a string-type.

An annoyance with ISO Pascal is that an array's size is part of
its type, and there is no separate slice type that could act
as a window into an array independent of size and be passed
around, so it is difficult to write procedures and functions
that operate on e.g. strings, generically.  See also,
https://www.lysator.liu.se/c/bwk-on-pascal.html

However, these deficiencies are largely addressed in ISO 10206
Extended Pascal, which provides a variable-length string type
and permits conformant array parameters, which for VSI Pascal
appear to monomorphize over the argument type.

It's perhaps worth noting that Wirth's subsequent languages,
particularly Oberon, didn't have most of these problems.

                            Regardless, it may be worthwhile to
at least mention it, since you state explicitly that there are
three types for representing textual, string-like data, but
VSI's documentation makes it clear that there are actually four.
>
Good point.
>
I have updated.
>
Also, it's a bit of a bummer that you didn't mention nested
functions/procedures, which are among the cooler aspects of the
language:
>
$ type foo.pas
(* foo *)
program foo(output);
procedure hello;
      procedure world(var who: String);
          function punct: char;
          begin
              punct := '!'
          end;
      begin
          who := 'World' + punct
      end;
var
      who: String (10);
begin
      world(who);
      writeln('Hello, ', who)
end;
begin
      hello
end.
>
There is already an example. fac is inside testfac.
>
I will add a note about it.
 
Ah, I see it now; the lack of indentation makes it hard to spot.
>
I don't indent them.
>
With the blank lines I put in then I feel that indenting
nested procedures/functions would make it too much space.

Meh, personally I sacrifice horizontal space for readability,
but I suppose styles differ.

- Dan C.


Date Sujet#  Auteur
1 Jan 25 * VMS Pascal article72Arne Vajhøj
1 Jan 25 +* Re: VMS Pascal article3Chris Townley
1 Jan 25 i+- Re: VMS Pascal article1Arne Vajhøj
1 Jan 25 i`- Re: VMS Pascal article1Dennis Boone
2 Jan 25 +* Re: VMS Pascal article18Marc Van Dyck
2 Jan 25 i`* Re: VMS Pascal article17Arne Vajhøj
3 Jan 25 i +* Re: VMS Pascal article5Lawrence D'Oliveiro
3 Jan 25 i i`* Re: VMS Pascal article4Arne Vajhøj
3 Jan 25 i i +* Re: VMS Pascal article2Lawrence D'Oliveiro
3 Jan 25 i i i`- Re: VMS Pascal article1Robert A. Brooks
3 Jan 25 i i `- Re: VMS Pascal article1Simon Clubley
3 Jan 25 i `* Re: VMS Pascal article11Arne Vajhøj
3 Jan 25 i  `* Re: VMS Pascal article10Robert A. Brooks
3 Jan 25 i   `* Re: VMS Pascal article9Arne Vajhøj
3 Jan 25 i    `* Re: VMS Pascal article8Robert A. Brooks
3 Jan 25 i     `* Re: VMS Pascal article7Arne Vajhøj
3 Jan 25 i      `* Re: VMS Pascal article6Robert A. Brooks
4 Jan 25 i       `* Re: SDL, SDLC, PL/I (was Re: VMS Pascal article)5Stephen Hoffman
4 Jan 25 i        +* Re: SDL, SDLC, PL/I (was Re: VMS Pascal article)3Arne Vajhøj
6 Jan 25 i        i`* Re: SDL, SDLC, PL/I (was Re: VMS Pascal article)2Simon Clubley
6 Jan 25 i        i `- Re: SDL, SDLC, PL/I (was Re: VMS Pascal article)1Robert A. Brooks
4 Jan 25 i        `- Re: SDL, SDLC, PL/I (was Re: VMS Pascal article)1Lawrence D'Oliveiro
3 Jan 25 +- Re: VMS Pascal article1David Meyer
3 Jan 25 +* Re: VMS Pascal article24Dan Cross
3 Jan 25 i`* Re: VMS Pascal article23Arne Vajhøj
3 Jan 25 i `* Re: VMS Pascal article22Dan Cross
3 Jan 25 i  `* Re: VMS Pascal article21Arne Vajhøj
3 Jan 25 i   `* Re: VMS Pascal article20Dan Cross
3 Jan 25 i    `* Re: VMS Pascal article19Arne Vajhøj
3 Jan 25 i     +* Re: VMS Pascal article4Dan Cross
3 Jan 25 i     i+* Re: VMS Pascal article2Dan Cross
4 Jan 25 i     ii`- Re: VMS Pascal article1Arne Vajhøj
4 Jan 25 i     i`- Re: VMS Pascal article1Arne Vajhøj
3 Jan 25 i     +* Re: VMS Pascal article2Lawrence D'Oliveiro
4 Jan 25 i     i`- Re: VMS Pascal article1Arne Vajhøj
5 Jan 25 i     `* Coding examples (Re: VMS Pascal article)12David Meyer
5 Jan 25 i      +* Re: Coding examples (Re: VMS Pascal article)2Arne Vajhøj
5 Jan 25 i      i`- Re: Coding examples (Re: VMS Pascal article)1Arne Vajhøj
5 Jan 25 i      `* Re: Coding examples (Re: VMS Pascal article)9Stephen Hoffman
6 Jan 25 i       `* Re: Coding examples (Re: VMS Pascal article)8Marc Van Dyck
6 Jan 25 i        +- Re: Coding examples (Re: VMS Pascal article)1Craig A. Berry
6 Jan 25 i        `* Re: Coding examples (Re: VMS Pascal article)6Arne Vajhøj
6 Jan 25 i         +- Re: Coding examples (Re: VMS Pascal article)1Arne Vajhøj
7 Jan 25 i         +- Re: Coding examples (Re: VMS Pascal article)1mjos_examine
8 Jan 25 i         `* Re: Coding examples (Re: VMS Pascal article)3Craig A. Berry
8 Jan 25 i          `* Re: Coding examples (Re: VMS Pascal article)2Arne Vajhøj
8 Jan 25 i           `- Re: Coding examples (Re: VMS Pascal article)1Lawrence D'Oliveiro
4 Jan 25 +- Re: VMS Pascal article1Martin Vorländer
6 Jan 25 +* Re: VMS Pascal article23John Reagan
7 Jan 25 i`* Re: VMS Pascal article22John Reagan
7 Jan 25 i +* Re: VMS Pascal article20Dan Cross
7 Jan 25 i i`* Re: VMS Pascal article19John Reagan
8 Jan 25 i i `* Re: VMS Pascal article18Dan Cross
8 Jan 25 i i  `* Re: VMS Pascal article17Arne Vajhøj
8 Jan 25 i i   +* Re: VMS Pascal article5Dan Cross
9 Jan 25 i i   i+- Re: VMS Pascal article1Arne Vajhøj
9 Jan 25 i i   i+- Re: VMS Pascal article1Simon Clubley
9 Jan 25 i i   i`* Re: VMS Pascal article2jayjwa
10 Jan 25 i i   i `- Re: VMS Pascal article1Craig A. Berry
9 Jan 25 i i   `* Re: VMS Pascal article11Dave Froble
9 Jan 25 i i    +* Re: VMS Pascal article5Arne Vajhøj
9 Jan 25 i i    i`* Re: VMS Pascal article4Dan Cross
9 Jan 25 i i    i `* Re: VMS Pascal article3Simon Clubley
10 Jan 25 i i    i  `* Re: VMS Pascal article2Simon Clubley
10 Jan 25 i i    i   `- Re: VMS Pascal article1Arne Vajhøj
9 Jan 25 i i    `* Re: VMS Pascal article5Arne Vajhøj
9 Jan 25 i i     +* Re: VMS Pascal article2Robert A. Brooks
9 Jan 25 i i     i`- Re: VMS Pascal article1Arne Vajhøj
9 Jan 25 i i     `* Re: VMS Pascal article2Simon Clubley
9 Jan 25 i i      `- Re: VMS Pascal article1Arne Vajhøj
8 Jan 25 i `- Re: VMS Pascal article1Arne Vajhøj
8 Jan 25 `- Re: VMS Pascal article1Arne Vajhøj

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal