Back to table

Redeclaration of a replicated variable

The following is an invalid µOCCAM program. See what happens when a replicated variable is already declared.

Program file: /public/cs3/web/ipptests/ctr.reject
INT foo = 1:
INT bar = 10:
INT ctr:

-- this next part probably counts as a redeclaration!
PAR ctr = 1 for 10
  SEQ
    foo := foo - ( bar * ctr )
    bar := bar -
      1
    -- it'd be nice to print out the output, it's probably a bit
    -- chaotic, but that requires i/o files.