big-faslend.red 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. % BIG-FASLEND.RED - Patch to FASLEND for huge files
  2. %
  3. % Author: Eric Benson
  4. % Symbolic Computation Group
  5. % Computer Science Dept.
  6. % University of Utah
  7. % Date: 7 May 1982
  8. % Copyright (c) 1982 University of Utah
  9. % <PSL.COMP>BIG-FASLEND.RED.4, 10-Jun-82 10:39:32, Edit by GRISS
  10. % Added InitCodeMax!* for testing
  11. %
  12. lisp procedure CompileUncompiledExpressions();
  13. <<ErrorPrintF("%n*** Init code length is %w%n",
  14. length car UncompiledExpressions!*);
  15. CompileInitCode('!*!*Fasl!*!*InitCode!*!*,
  16. car UncompiledExpressions!*)>>;
  17. FLUID '(InitCodeMax!*);
  18. LoadTime <<InitCodeMax!*:=350>>;
  19. lisp procedure CompileInitCode(Name, InitCodeList);
  20. begin scalar X, Len, LastHalf;
  21. return if ILessP(Len := length InitCodeList, InitCodeMax!*) then
  22. DfPrintFasl list('de, Name, '(), 'progn . InitCodeList)
  23. else
  24. << ErrorPrintF(
  25. "*** Initcode length %w too large, splitting into smaller pieces", Len);
  26. ErrorPrintF("*** Please use smaller files in FASL");
  27. X := PNTH(InitCodeList, IQuotient(Len, 2));
  28. LastHalf := cdr X;
  29. Rplacd(X, NIL); % tricky, split the code in 2
  30. X := Intern Concat(ID2String Name, StringGensym());
  31. Flag1(X, 'InternalFunction); % has to be internal to get called!
  32. CompileInitCode(X,
  33. InitCodeList);
  34. CompileInitCode(Name, list X . LastHalf) >>; % call previous
  35. end;