Artifact e7f4aa89ad90e5cb3f87a03006a8cf1395e47302dee55290c8e5f909352372b1:
- File
psl-1983/3-1/kernel/vectors.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 3125) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/kernel/vectors.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 3125) [annotate] [blame] [check-ins using]
% % VECTORS.RED - Standard Lisp Vector functions % % Author: Eric Benson % Symbolic Computation Group % Computer Science Dept. % University of Utah % Date: 20 August 1981 % Copyright (c) 1981 University of Utah % % <PSL.KERNEL>VECTORS.RED.2, 10-Jan-83 15:54:19, Edit by PERDUE % Added EGetV etc. for EVectors, paralleling Vectors % MkVect and MkEVector are found in PK:CONS-MKVECT.RED on SysLisp; syslsp procedure GetV(Vec, I); %. Retrieve the I'th entry of Vec begin scalar StripV, StripI; return if VectorP Vec then if IntP I then % can't have vectors bigger than INUM << StripV := VecInf Vec; StripI := IntInf I; if StripI >= 0 and StripI <= VecLen StripV then VecItm(StripV, StripI) else StdError BldMsg('"Subscript %r in GetV is out of range", I) >> else IndexError(I, 'GetV) else NonVectorError(Vec, 'GetV); end; syslsp procedure PutV(Vec, I, Val); %. Store Val at I'th position of Vec begin scalar StripV, StripI; return if VectorP Vec then if IntP I then % can't have vectors bigger than INUM << StripV := VecInf Vec; StripI := IntInf I; if StripI >= 0 and StripI <= VecLen StripV then VecItm(StripV, StripI) := Val else StdError BldMsg('"Subscript %r in PutV is out of range", I) >> else IndexError(I, 'PutV) else NonVectorError(Vec, 'PutV); end; syslsp procedure UpbV V; %. Upper limit of vector V if VectorP V then MkINT VecLen VecInf V else NIL; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% EVectors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% syslsp procedure EVECTORP V; TAG(V) EQ EVECT; syslsp procedure EGETV(Vec, I); %. Retrieve the I'th entry of Vec begin scalar StripV, StripI; return if EvectorP Vec then if IntP I then % can't have vectors bigger than INUM << StripV := VecInf Vec; StripI := IntInf I; if StripI >= 0 and StripI <= VecLen StripV then VecItm(StripV, StripI) else StdError BldMsg('"Subscript %r in EGETV is out of range", I) >> else IndexError(I, 'EGETV) else NonVectorError(Vec, 'EGETV); end; syslsp procedure Eputv(Vec, I, Val); %. Store Val at I'th position of Vec begin scalar StripV, StripI; return if EvectorP Vec then if IntP I then % can't have vectors bigger than INUM << StripV := VecInf Vec; StripI := IntInf I; if StripI >= 0 and StripI <= VecLen StripV then VecItm(StripV, StripI) := Val else StdError BldMsg('"Subscript %r in Eputv is out of range", I) >> else IndexError(I, 'Eputv) else NonVectorError(Vec, 'Eputv); end; syslsp procedure EUpbV V; %. Upper limit of vector V if EvectorP V then MkINT EVecLen EVecInf V else NIL; off SysLisp; END;