source: branches/typed-asm/abcl/examples/misc/dotabclrc

Last change on this file was 14231, checked in by Mark Evenson, 12 years ago

Add common (for me) customizations of ABCL output.

File size: 4.0 KB
Line 
1;;; -*- Mode: Lisp -*-
2
3;;; Possible code for inclusion in the Armed Bear startup file
4;;; #p"~/.abclrc"
5
6
7;;; Some commonly useful customizations to ABCL output
8(setf
9 ;; Truncate the output of java.lang.String object after this many
10 ;; characters, outputing "...." afterwards. 
11 ;; The default is 32.  Is this too small?
12 *java-object-to-string-length* 8192
13
14 ;; Show what is being loaded and the loading time. 
15 ;; Helpful on slower systems to figure out what is taking the time.
16 *load-verbose* t
17
18 ;; Emit warnings from debug code
19 sys:*debug-warn* t
20
21 ;; Bring some order to the forms output by the REPL
22 ;; Not currently the default, but it probably should be after we
23 ;; rework the pretty printer and/or streams to properly work with
24 ;; GRAY-STREAMS:
25 *print-pretty* t)
26
27#-quicklisp
28(let ((quicklisp-local  #P"~/quicklisp/setup.lisp")
29      (quicklisp-remote #p"http://beta.quicklisp.org/quicklisp.lisp"))
30  (unless (probe-file quicklisp-local)
31    (when (probe-file quicklisp-remote)     ;;; XXX possibly search for a proxy÷
32      (load quicklisp-remote)
33      (funcall (intern (symbol-name 'install) :quicklisp-quickstart))))
34  (when (probe-file quicklisp-local)
35    (load quicklisp-local)))
36
37;;
38(require :asdf)
39(require :abcl-contrib)
40(require :abcl-asdf)
41(setf abcl-asdf::*maven-http-proxy* "http://localhost:3128/")
42
43;;; Customize the procedure used by CL:DISASSEMBLE
44(setf *disassembler*       
45      (let ((strategies (list (lambda (p)
46                                (let ((class (make-pathname :name (pathname-name p)))
47                                      (path (directory-namestring p)))
48                                  (format nil "javap -c -l -verbose -classpath ~A ~A" path class)))
49                              "/Users/evenson/bin/jad -a -p"
50                              (lambda (p)
51                                (format nil "java -jar ~
52/Users/evenson/work/classfileanalyzer/classfileanalyzer.jar ~A"
53                                        p)))))
54          (first strategies)))
55
56(defparameter *ansi-tests-directory*
57  #-(or windows mswindows win32)
58  #p"/home/peter/xcl/x/ansi-tests/"
59  #+(or windows mswindows win32)
60  #p"c:\\msys\\1.0\\home\\peter\\xcl\\x\ansi-tests\\")
61
62(defun run-ansi-tests (&optional (compile-tests t))
63  (format t "COMPILE-TESTS is ~A~%" compile-tests)
64  (let ((*default-pathname-defaults* *ansi-tests-directory*))
65    #+(and abcl unix)
66    (run-shell-command "make clean" :directory *default-pathname-defaults*)
67    (time (load (if compile-tests "compileit.lsp" "doit.lsp")))))
68
69(defun run-random-tests (size nvars count)
70  (let ((*default-pathname-defaults* *ansi-tests-directory*))
71    (load "gclload1.lsp")
72    (load "random-int-form.lsp")
73    (let ((f (find-symbol "TEST-RANDOM-INTEGER-FORMS" "CL-TEST")))
74      (when f
75        (let (#+abcl (*suppress-compiler-warnings* t)
76              (*random-state* (make-random-state t)))
77          (time (funcall f size nvars count)))))))
78
79#+(or abcl sbcl clisp)
80(defun test-cl-ppcre ()
81  #+abcl (require "JVM")
82  (let ((*default-pathname-defaults* #-(or windows mswindows win32)
83                                     #p"/home/peter/cl-ppcre-1.2.19/"
84                                     #+(or windows mswindows win32)
85                                     #p"c:\\cygwin\\home\\peter\\cl-ppcre-1.2.19\\"))
86    #+abcl
87    (map nil #'delete-file (directory "*.abcl"))
88    #+sbcl
89    (map nil #'delete-file (directory "*.fasl"))
90    (load "load.lisp")
91    (let ((f (find-symbol "TEST" "CL-PPCRE-TEST")))
92      (when f
93        #+abcl (gc)
94        (time (funcall f))
95        #+abcl (gc)
96        (time (funcall f))))))
97
98#+abcl
99(defun run-other-tests ()
100  (test-cl-ppcre)
101  (let ((*default-pathname-defaults* "/home/peter/salza-0.7.2/"))
102    (map nil #'delete-file (directory "*.abcl"))
103    (load "/home/peter/test-salza.lisp")
104    (gc)
105    (test-salza)
106    (gc)
107    (test-salza)))
108
109#+abcl
110(autoload 'do-tests "rt.lisp")
111
112#+allegro
113(top-level:alias "ap" (arg) (apropos arg nil nil t))
114#+allegro
115(top-level:alias "de" (arg) (describe (eval arg)))
116
117#+cmu
118(setf *gc-verbose* nil)
119
120;; #+sbcl
121;; (require '#:asdf)
122;; #+sbcl
123;; (require '#:sb-aclrepl)
Note: See TracBrowser for help on using the repository browser.