lock = interface { free, locked } new = method() replies(self{free}) lock = method({free}l:self{locked}) free = method({locked}l:self{free}) end lock locki = class implements lock new = method() replies(self{free}) reply(self$[]!{free}) end new lock = method({free}l:self{locked}) l!{locked} end lock free = method({locked}l:self{free}) l!{free} end free end locki bbufl = interface extends bbuf and lock new = method(n:int) replies(self{empty.free}) put = method({empty.free,mid.free}b:self{mid.free,full.free}, i:int) get = method({full.free,mid.free}b:self{mid.free,empty.free}) replies(int) end bbufl