[fpc-pascal] with statement using mulltiple objects

Bernd Oppolzer bernd.oppolzer at t-online.de
Sun Sep 14 16:52:44 CEST 2014


The reason why I made these comparisons to PL/1:

PL/1 was designed in the mid 60s, and Wirth of course knew about PL/1,
because he was at IBM at the time, and of course he was aware of the 
problems
and pitfalls of PL/1. By including the WITH statement into PASCAL, he 
probably
wanted to give the coders some possibilities for an abbreviation 
(similar to PL/1,
but avoiding most of the problems). As we look at it today, not all 
problems have been
avoided.

Of course, most inspirations for PASCAL came from ALGOL 60. But ALGOL 60
had no structures, so PL/1 was the natural source of inspiration, at 
that time.

Kind regards

Bernd


Am 14.09.2014 16:30, schrieb Bernd Oppolzer:
> The possible dangers of using WITH are only very limited, compared
> to other languages, for example PL/1, where
>
> - you don't need to declare variables, like in FORTRAN
> - you can omit structure qualifiers, if the the structure components 
> alone are unique
> - if the structure component is A.B.C, you can write A.C, B.C or 
> simply C, if it is unique in the program
> - if there is both a simple variable C and a structure component A.C 
> (C in an outer block),
> I guess, A.C will be used, if you write only C (but I am not sure on 
> this; hopefully there will be
> a compiler warning)
> - if you have a combination of vectors and structures, the order of 
> structure components
> and vector indices is not fixed, that is: A.C(N,M) is the same as 
> A(N).C(M) is the same as
> A(N,M).C ... regardless of the definition of the structures / vectors 
> A and C.
>
> You may read some old articles from Dijkstra and C.A.R. Hoare on this 
> topic,
> covering PL/1 ... it is very hard to write reliable programs using 
> this language,
> but it is still in use until today in very large banks and insurance 
> companies.
> I am using it in my everyday work.
>




More information about the fpc-pascal mailing list