On Sun, Nov 3, 2024 at 10:35 PM Tony Duell via cctalk <cctalk@classiccmp.org> wrote: > This is one of the few high level languages I've seen with a > specific instruction for self-modifying code.
Don't forget the ALTER statement in COBOL which changes a GO TO statement in some paragraph somewhere to point to a different destination than what's written in the source code. COBOL has a few funky features. Another one is that you can have a sequence of Paragraphs: PARA-A. PARA-B. PARA-C. PARA-D. And in one place you can say PERFORM PARA-A THROUGH PARA-C, and in another place PERFORM PARA-B THROUGH PARA-D, etc. which means you have to somehow pass in the paragraph you want to return from and every paragraph has to end with a conditional return based on whether it's the requested exit point. Some machines had special machine instructions for COBOL Paragraph call and return to help deal with these and similar oddities.