Talk:SYCPOL

From Esolang
Jump to navigation Jump to search

Another idea would be to fix it so that it will work even if the cards are placed in the wrong order. Such as, the division and/or section, and what it belongs to, must be mentioned on each card if applicable (a PROCEDURE CODE SECTION, or any other section inside of a procedure definition, needs the procedure name somewhere above it on the same card; MAIN PROCEDURE or PROCEDURE CODE SECTION or STORAGE DIVISION or whatever needs to be respecified at the top of each card if it is longer than a single card; an EXTERNAL PROCEDURE declaration needs to specify the MODULE NAME and IDENTIFIER on the same card; etc). PROGRAM CODE DIVISION can be made optional to specify if it starts at the top of a card. Spacing and indentation rules should be corrected in order that an entire statement can therefore fit into one card (some things (mainly declarations) do not need to be changed and can be made strict in their exact spacing; other things can be made less strict, so that line breaks can be allowed anywhere inside of a statement although at least one space is required at the beginning of a line which doesn't start a statement, and other lines don't start with spaces unless they are blank). There are already line numbers, so that already helps to know the proper ordering. Such things as I mentioned can be considered as extensions, so that the standard SYCPOL can still be used and an extended implementation is still fully compatible with loading standard programs. --Zzo38 (talk) 08:52, 29 June 2014 (UTC)

Good ideas. I think that would require a new MODULE-declaration to distinguish modules. A minimal hello world would be:
PROGRAM           CARD
STANDARD SYSTEM CARD I
@HELLO          MODULE
DOCUMENTATION DIVISION
IDENTIFIER    STRING 8
"HELLO"

IMPORTS       DIVISION

!PS EXTERNAL PROCEDURE

IDENTIFIER   STRING 16
"PRINT TO STREAM"

MODULE NAME   STRING 8
"STDIO"






PROGRAM           CARD
STANDARD SYSTEM CARD I
@HELLO          MODULE
INPUT OUTPUT  DIVISION

OPEN STANDARD OUTPUT
CLOSE STANDARD INPUT

.OUT     OUTPUT STREAM
OUTS STANDARD OUTPUT

STORAGE       DIVISION

.HELLO        STRING 8
"HELLO"

.WORLD        STRING 8
"WORLD"




PROGRAM           CARD
STANDARD SYSTEM CARD I
@HELLO          MODULE
MAIN         PROCEDURE
(1) PROCEED TO !PS
      WITH
        .HELLO
        .OUT

(2) PROCEED TO !PS
      WITH
        .WORLD
        .OUT

(3) RETURN
      WITH SUCCESS






I think those cards may be in any order. – GermanyBoy (talk) 13:31, 29 June 2014 (UTC)