Artifact e65e25c076e931103ffe0332ceebeae7868befe80d79066c8a27313d462d38f7:


% MINI-READ.RED - A small reader

CompileTime <<GLOBAL '(DEBUG);
              FLUID '(TOK!* TOKTYPE!* CH!* !*RAISE);>>;

Procedure READ;        
% start RATOM, get first fresh token
  Read1(Ratom());

Procedure READ1(x);
   If x eq '!( then  READLIST(RATOM()) % Skip the (
    else if  x eq '!' then CONS('QUOTE, NCONS READ())
    else x;

Procedure ReadList(x);    
% read LIST, starting at token x
 Begin scalar y;
  If x eq '!) then Return NIL;
  y:=Read1(x);   % Finish read CAR of pair
  x:=Ratom();    % Check dot
  If x eq '!. then return CONS(y,car READLIST(RATOM()));
  Return CONS(y , READLIST(x))
End;

End;


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]