anchor.diff:  
   % TODO: clear import buffer
   
  +% type untyped definition
  +shell_step( ShellState = #shell_state{ string_buf = "",
  +                                       token_buf  = [],
  +                                       token_lst  = [],
  +                                       def_buf    = [_|_] } ) ->
  +
  +  #shell_state{ def_buf   = [D1|DBuf],
  +                def_lst   = DefLst,
  +                reply_lst = ReplyLst } = ShellState,
  +
  +  {_, _, E} = D1,
  +
  +  ShellState1 = 
  +    case cuneiform_type:type( cuneiform_parse:create_closure( DefLst++[D1], E ) ) of
  +
  +      {ok, T} ->
  +
  +        ReplyLst1 = ReplyLst++[{parrot, E, T}],
  +        DefLst1 = DefLst++[D1],
  +
  +        ShellState#shell_state{ def_buf   = DBuf,
  +                                def_lst   = DefLst1,
  +                                reply_lst = ReplyLst1 };
  +
  +      {error, Reason} ->
  +
  +        ReplyLst1 = ReplyLst++[{error, type, Reason}],
  +
  +        ShellState#shell_state{ def_buf = DBuf, reply_lst = ReplyLst1 }
  +
  +    end,
  +
  +  {ok, ShellState1};
  +
  +
  +
  +
  +% extract imports, definitions, and queries if token list can be parsed
   shell_step( ShellState = #shell_state{ string_buf = "",
                                          token_buf  = [],
                                          token_lst  = [_|_] } ) ->
   
     #shell_state{ token_lst  = TokenLst,
                   import_buf = ImportBuf,
  -                def_lst    = DefLst,
  +                def_buf    = DefBuf,
                   query_lst  = QueryLst,
                   reply_lst  = ReplyLst } = ShellState,
   
  
positive.code:                        token_lst  = [],
                         import_buf = [],
                         import_lst = [],
                         def_lst    = [],
                         query_lst  = [],
                         reply_lst  = []} ).
  
negative.code: 
  get_help() ->
    string:join(
      [?BYLW( "help" )++?YLW( " show this usage info" ),
       ?BYLW( "hist" )++?YLW( " show definition history" ),
       ?BYLW( "quit" )++?YLW( " quit the shell" )
  ], "\n" ).
  
  
  