All pastes #354098 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-13 19:38 UTC
rendered paste body
-- replacement plus thingy for use in pairs.reset
PROC invertplus(CHAN INT in.0?, in.1?, reset?, out!)
  BOOL a:
  SEQ
    WHILE TRUE
      SEQ
        a := FALSE
        INT tmp:
        -- this doesn't work presumably due to some sort of issue with scope
        -- my brain only of course working in java
        PRI ALT
          reset ? tmp
            IF
              a = TRUE
                a := FALSE
              a = FALSE
                a := TRUE
          SKIP
            IF
              a = FALSE
                INT int.0, int.1:
                SEQ
                  PAR
                    in.0 ? int.0
                    in.1 ? int.1
                  out ! int.0 + int.1
              a = TRUE
                INT int.0, int.1:
                SEQ
                  PAR
                    in.0 ? int.0
                    in.1 ? int.1
                  out ! int.0 - int.1
: