Self-modifying code

Bjorn Lisper lisper-bjorn at CS.YALE.EDU
Mon Aug 22 12:55:58 AEST 1988


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 withing it.  Instead of machine pointers they
>pass arround indexes into the array.  This has defeated the purpose
>of the Pascal tight checking, reintroduced all the old danger of
>running off the end of your allocated memory (into a chunk logically
>attached to another pseudo pointer), and increased the notational complexity
>of the program (and probability of errors).  If you examine these programs
>and what they accomplish, you will usually conclude 
>  1) This was the best choice that could be made given the constraints
>     of the language
>  2) The programmer must have been persistent to get the thing working
>     at all.

Just a comment on this....this is the typical technique to implement
pointers and dynamic memory handling in Fortran, that to the contrary of
Pascal doesn't have pointer types and dynamic memory allocation as language
primitives. Are "those Pascal programs" maybe translated Fortran programs?

Bjorn Lisper



More information about the Comp.lang.c mailing list