one large array in Pascal

David S. Bakin dsb at igor.uucp
Sun Aug 28 13:16:04 AEST 1988


In article <1268 at mcgill-vision.UUCP> mouse at mcgill-vision.UUCP (der Mouse) writes:
>In article <36174 at yale-celray.yale.UUCP>, lisper-bjorn at CS.YALE.EDU (Bjorn Lisper) writes:
>> In article <20349 at watmath.waterloo.edu> atbowler at watmath.waterloo.edu (Alan T. Bowler [SDG]) writes:
>>> A classic example are those Pascal programs that allocate 1 large
>>> static linear array and then run their own memory allocator [...].
>> Just a comment on this....this is the typical technique to implement
>> pointers and dynamic memory handling in Fortran, [...].  Are "those
>> Pascal programs" maybe translated Fortran programs?
>
>I know of at least one which isn't: TeX.
>
>Why did Knuth do it this way?  I can only guess; I would guess that
>it's for some portability reason I am not aware of.

TeX is written in a subset of Pascal that doesn't include 'with'
statements, any use of the heap, set types, enumerated scalar types, 'var'
parameters, tag fields on variant records, assignments real := integer,
or nested procedure declarations.  It is nearly character-set independent,
and goes to great lengths to use only portable constructs for exact
arithmetic.  The goal was to make it as easy to port
as possible to the various brain-damaged Pascal compilers that existed at
the time; in fact it is now automatically translated into C, and possibly
other languages as well.  -- Dave
----------------------------------------------------------
Dave Bakin				    (408) 496-3600
c/o Rational; 3320 Scott Blvd.; Santa Clara, CA 95054-3197
Internet:  dsb at rational.com	 Uucp:  ...!uunet!igor!dsb



More information about the Comp.lang.c mailing list