ecl/examples/android/assets/lisp/etc/user.lisp
Daniel Kochmański 899a88a727 android/example: clean up the init scripts
Move the ASDF cache initialization below it's inclusion and don't be so
noisy with swank.

Also add the function sysinit which downloads and installs the Quicklisp
and replaces it's interpreted gunzip with our precompiled deflate.
2015-10-23 18:18:58 +02:00

62 lines
2.7 KiB
Common Lisp

(in-package :cl-user)
(setq *default-directory*
*default-pathname-defaults*)
(defun sysinfo (&optional (out *standard-output*))
"Print the current environment to a stream."
(declare (stream out))
(format out "~&~%~75~~%~75,,,'-:@<<{[ The current environment ]}>~>~%~
Implementation:~20t~a~%~7tversion:~20t~a~%Machine: type:~20t~a
~7tversion:~20t~a~%~6tinstance:~20t~a~%Opeating System:~19t"
(lisp-implementation-type) (lisp-implementation-version)
(machine-type) (machine-version) (machine-instance))
#+darwin (princ " Darwin")
#+unix (princ " Unix")
(format out "~%Software: type:~20t~a~%~7tversion:~20t~a~%Site:~20t~a (~a)
User home:~20t~a~%Current directory:~20t~a~%Default pathname:~20t~a~%"
(software-type) (software-version) (long-site-name)
(short-site-name) (user-homedir-pathname) *default-directory*
*default-pathname-defaults*)
(format out "Features: ~s.
Modules:~s.~%
Current package:~s~%"
*features* *modules* *package*)
(flet ((exdi (fl) (integer-length (nth-value 1 (decode-float fl)))))
(format out "Fixnum length:~25t~3d bits
Short Floats:~25t~3d bits exponent, ~3d bits significand (mantissa)
Single Floats:~25t~3d bits exponent, ~3d bits significand (mantissa)
Double Floats:~25t~3d bits exponent, ~3d bits significand (mantissa)
Long Floats:~25t~3d bits exponent, ~3d bits significand (mantissa)~%"
(integer-length most-positive-fixnum)
(exdi most-positive-short-float)
(float-digits most-positive-short-float)
(exdi most-positive-single-float)
(float-digits most-positive-single-float)
(exdi most-positive-double-float)
(float-digits most-positive-double-float)
(exdi most-positive-long-float)
(float-digits most-positive-long-float)))
(dolist (sy '(array-total-size-limit array-rank-limit array-dimension-limit
lambda-parameters-limit call-arguments-limit
multiple-values-limit char-code-limit))
(format out " ~a:~30t~15:d~%" sy (symbol-value sy)))
(format out "lambda-list-keywords:~s~%"
lambda-list-keywords)
(format out "Internal time unit:~25t~f sec~%*gensym-counter*:~25t~:d
Current time:~25t" (/ internal-time-units-per-second) *gensym-counter*)
(format out "~a" (get-universal-time))
(format out "~%~75~~%") (room) (values))
(defun sysinit ()
(format t "Loading the quicklisp subsystem~%")
(require '#:ecl-quicklisp)
(require '#:deflate)
(require '#:ql-minitar)
;; Replace the interpreted function with the precompiled equivalent
;; from DEFLATE
(eval (read-from-string
"(setf (symbol-function 'ql-gunzipper:gunzip) #'deflate:gunzip))")))
(sysinfo)
;; (sysinit)