File psl-1983/3-1/tests/mini-property-list.red artifact 5ddeb8946e part of check-in d9e362f11e


% MINI-PROPERTY-LIST.RED - Small GET and PUT

on syslisp;

Procedure Prop x;
 If not IDP x then NIL
  else SYMPRP IDINF x;

Procedure Get(x,y);
 Begin scalar z,L;
   If Not IDP x  then return NIL;
   L:=SYMPRP IDINF x;
   If (Z:=Atsoc(y,L)) then return CDR Z;
   Return NIL;
 End;

Procedure Put(x,y,z);
 Begin scalar P,L;
   If Not IDP x  then return NIL;
   L:=SYMPRP IDINF x;
   If (P:=Atsoc(y,L)) then return	% 
      <<CDR(PairInf P):=z; z>>;
   L:=CONS(CONS(y,z),L);
   SYMPRP(IDINF x):=L;
   Return z;
 End;

Procedure RemProp(x,y);
 Begin scalar P,L;
   If Not IDP x  then return NIL;
   L:=SYMPRP IDINF x;
   If not(P:=Atsoc(y,L)) then return NIL;
   L:=Delatq(y,L);
   SYMPRP(IDINF x):=L;
   Return CDR P;
 End;

Procedure GetFnType x;
  Get(x,'TYPE);

off syslisp;

end;


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