[mercury-users] Records

Richard A. O'Keefe ok at hermes.otago.ac.nz
Mon Nov 8 09:56:59 AEDT 1999


Fergus Henderson <fjh at cs.mu.oz.au>, remarking on my
Algol 68-ish "field of record" suggestion, wrote:

	I used to work with a group of COBOL programmers once;
        they disliked [COBOL's OF/IN] syntax so much that they did not use it,
	...
		DATA DIVISION.
		WORKING STORAGE SECTION.
		01  WS-EMPLOYMENT-RECORD.
		    03  WS-EMPLOYMENT-START-DATE.
		        05  WS-EMPLOYMENT-START-YEAR    PIC 99.
		        05  WS-EMPLOYMENT-START-MONTH   PIC 99.
		        05  WS-EMPLOYMENT-START-DAY     PIC 99.
		    03  WS-EMPLOYMENT-END-DATE.
		        05  WS-EMPLOYMENT-END-YEAR      PIC 99.
		        05  WS-EMPLOYMENT-END-MONTH     PIC 99.
		        05  WS-EMPLOYMENT-END-DAY       PIC 99.
	
		PROGRAM DIVISION.
		...
		IF WS-EMPLOYMENT-START-YEAR < WS-EMPLOYMENT_END_YEAR ...
	
They must have really hated "MOVE CORRESPONDING".
With well-chosen shorter names,
	IF YEAR OF START OF EMPLOYMENT IS LESS THAN YEAR OF END OF EMPLOYMENT
is not so verbose.  The main problem with COBOL was not direct verbosity but
lack of programmer-defined functions.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list