others-sl.red 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. %
  2. % OTHERS-SL.RED - Random Standard Lisp functions
  3. %
  4. % Author: Eric Benson
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 20 August 1981
  9. % Copyright (c) 1981 University of Utah
  10. %
  11. % These are functions that didn't have a logical home
  12. % Most could have been defined portably, but were not for efficiency reasons
  13. on SysLisp;
  14. off R2I;
  15. syslsp procedure FixP U; %. Is U an integer?
  16. FixP U;
  17. on R2I;
  18. syslsp procedure Digit U; %. Is U an ID whose print name is a digit?
  19. IDP U and (U := IDInf U) >= char !0 and U <= char !9;
  20. syslsp procedure Liter U; %. Is U a single character alphabetic ID?
  21. IDP U and ((U := IDInf U) >= char A and U <= char Z
  22. or U >= char !a and U <= char !z);
  23. off SysLisp;
  24. CompileTime flag('(Length1), 'InternalFunction);
  25. lisp procedure Length U; %. Length of list U
  26. Length1(U, 0);
  27. lisp procedure Length1(U, N);
  28. if PairP U then Length1(cdr U, IAdd1 N) else N;
  29. END;