File: package.lisp

package info (click to toggle)
acl2 8.0dfsg-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 226,956 kB
  • sloc: lisp: 2,678,900; ansic: 6,101; perl: 5,816; xml: 3,586; cpp: 2,624; ruby: 2,576; makefile: 2,443; sh: 2,312; python: 778; yacc: 764; ml: 763; awk: 260; csh: 186; php: 171; lex: 165; tcl: 44; java: 41; asm: 23; haskell: 17
file content (77 lines) | stat: -rw-r--r-- 3,023 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#+xcvb (module ())

(in-package :cl-user)

#+:abcl
(eval-when (:compile-toplevel :load-toplevel :execute)
  (require :gray-streams))

#+cmu
(eval-when (:compile-toplevel :load-toplevel :execute)
  (require :gray-streams))

#+allegro
(eval-when (:compile-toplevel :load-toplevel :execute)
  (unless (fboundp 'excl:stream-write-string)
    (require "streamc.fasl")))

#+ecl
(eval-when (:compile-toplevel :load-toplevel :execute)
  (gray::redefine-cl-functions))

(macrolet
    ((frob ()
       (let ((gray-class-symbols
              '(#:fundamental-stream
                #:fundamental-input-stream #:fundamental-output-stream
                #:fundamental-character-stream #:fundamental-binary-stream
                #:fundamental-character-input-stream #:fundamental-character-output-stream
                #:fundamental-binary-input-stream #:fundamental-binary-output-stream))
             (gray-function-symbols
              '(#:stream-read-char
                #:stream-unread-char #:stream-read-char-no-hang
                #:stream-peek-char #:stream-listen #:stream-read-line
                #:stream-clear-input #:stream-write-char #:stream-line-column
                #:stream-start-line-p #:stream-write-string #:stream-terpri
                #:stream-fresh-line #:stream-finish-output #:stream-force-output
                #:stream-clear-output #:stream-advance-to-column
                #:stream-read-byte #:stream-write-byte)))
	 `(progn

            (defpackage impl-specific-gray
              (:use :cl)
              (:import-from
               #+sbcl :sb-gray
               #+allegro :excl
               #+cmu :ext
               #+(or clisp ecl mocl) :gray
               #+openmcl :ccl
               #+lispworks :stream
               #+abcl :gray-streams
               #-(or sbcl allegro cmu clisp openmcl lispworks ecl abcl mocl) ...
               ,@gray-class-symbols
               ,@gray-function-symbols)
              (:export
               ,@gray-class-symbols
               ,@gray-function-symbols))

            (defpackage :trivial-gray-streams
              (:use :cl)
              (:import-from #:impl-specific-gray
                            ;; We import and re-export only
                            ;; function symbols;
                            ;; But we define our own classes
                            ;; mirroring the gray class hierarchy
                            ;; of the lisp implementation (this
                            ;; is necessary to define our methods
                            ;; for particular generic functions)
                            ,@gray-function-symbols)
              (:export ,@gray-class-symbols
                       ,@gray-function-symbols
                       ;; extension functions
                       #:stream-read-sequence
                       #:stream-write-sequence
                       #:stream-file-position
                       ;; deprecated
                       #:trivial-gray-stream-mixin))))))
  (frob))