anchor.diff:  %%% non-negative integers, and EOF is -1.
   %%%
   %%% TODO:
  -%%% - output ports
   %%% - textual-port stuff
   %%% - binary-port stuff
   
  
positive.code: 	 open_input_string/1,
  	 open_stdin/0]).
  
  %% Generic input port infrastructure
  
  -record(input_port_fns,
  	{close,
  	 read_char,
  	 peek_char,
  	 is_char_ready}).
  
  handle_input_port(State0, Fns) ->
    receive
      {Pid, Cmd} when is_pid(Pid), is_atom(Cmd) ->
        case Cmd of
  	'read_char' ->
  	  {R, State1} = (Fns#input_port_fns.read_char)(State0),
  	  Pid ! {self(), R},
  	  handle_input_port(State1, Fns);
  	'peek_char' ->
  	  {R, State1} = (Fns#input_port_fns.peek_char)(State0),
  	  Pid ! {self(), R},
  	  handle_input_port(State1, Fns);
  	'is_char_ready' ->
  	  R = (Fns#input_port_fns.is_char_ready)(State0),
  	  Pid ! {self(), R},
  	  handle_input_port(State0, Fns);
  	'close' ->
  	  R = (Fns#input_port_fns.close)(State0),
  	  Pid ! {self(), R};
  	_ ->
  	  R = {error, Cmd},
  	  Pid ! {self(), R},
  	  handle_input_port(State0, Fns)
        end;
      _ ->
        handle_input_port(State0, Fns)
    end.
  
  command(Pid, Cmd) ->
    MonRef = erlang:monitor('process', Pid),
  
negative.code: 	  -1
        end,
    {{ok, V}, S}.
  
  %% File input ports
  
  