Skip to content

Commit 9691f04

Browse files
authored
Merge pull request #209 from gmpalter/master
Add support for Genera
2 parents 09dde88 + 8c1468d commit 9691f04

File tree

7 files changed

+55
-11
lines changed

7 files changed

+55
-11
lines changed

quicklisp/bundle.lisp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,12 @@
202202

203203
(defmethod write-loader-script ((bundle bundle) stream)
204204
(let ((template-lines
205-
(load-time-value
206-
(with-open-file (stream #. (merge-pathnames "bundle-template"
205+
(load-time-value
206+
;; On Genera, the semantics of Unix pathnames cause merging a filename with
207+
;; no type against defaults with a type to leave the type as :UNSPECIFIC.
208+
;; So, explicitly provide the type here to avoid that problem. (I'm not
209+
;; sure what would happen if I were to change that behavior. --Palter)
210+
(with-open-file (stream #. (merge-pathnames "bundle-template.lisp"
207211
(or *compile-file-truename*
208212
*load-truename*)))
209213
(loop for line = (read-line stream nil)

quicklisp/http.lisp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
13)
2525
((eql char :lf)
2626
10)
27+
((eql char :tab)
28+
9)
2729
(t
2830
(let ((code (char-code char)))
2931
(if (<= 0 code 127)
@@ -32,7 +34,7 @@
3234
char))))))
3335

3436
(defvar *whitespace*
35-
(list (acode #\Space) (acode #\Tab) (acode :cr) (acode :lf)))
37+
(list (acode #\Space) (acode :tab) (acode :cr) (acode :lf)))
3638

3739
(defun whitep (code)
3840
(member code *whitespace*))
@@ -74,6 +76,7 @@
7476
(ecase key
7577
(:cr 13)
7678
(:lf 10)
79+
(:tab 9)
7780
((t) t)))))
7881
(if (consp keys) keys (list keys)))))
7982
`(case ,value
@@ -550,7 +553,7 @@ the indexes in the header accordingly."
550553
(return-from process-header header))
551554
(in-new-line (code)
552555
(acase code
553-
((#\Tab #\Space) (setf mark nil) #'in-value)
556+
((:tab #\Space) (setf mark nil) #'in-value)
554557
(t
555558
(when mark
556559
(save mark value-ends))
@@ -569,7 +572,7 @@ the indexes in the header accordingly."
569572
#'in-value)
570573
((:cr :lf)
571574
(finish))
572-
((#\Tab #\Space)
575+
((:tab #\Space)
573576
(error "Unexpected whitespace in header field name"))
574577
(t
575578
(unless (<= 0 code 127)

quicklisp/impl-util.lisp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
".cmucl-init.lisp")
8181
(:implementation scl
8282
".scl-init.lisp")
83+
(:implementation genera
84+
"lispm-init.lisp")
8385
)
8486

8587
(defun init-file-name-for (&optional implementation-designator)
@@ -174,7 +176,9 @@ quicklisp at CL startup."
174176
(:implementation t
175177
(file-write-date pathname))
176178
(:implementation clisp
177-
(nth-value 2 (ql-clisp:probe-pathname pathname))))
179+
(nth-value 2 (ql-clisp:probe-pathname pathname)))
180+
(:implementation genera
181+
(file-write-date (ql-genera:send pathname :directory-pathname-as-file))))
178182

179183

180184
;;;
@@ -195,7 +199,12 @@ quicklisp at CL startup."
195199
(:implementation allegro
196200
(ql-allegro:file-directory-p entry :follow-symbolic-links nil))
197201
(:implementation lispworks
198-
(ql-lispworks:file-directory-p entry)))
202+
(ql-lispworks:file-directory-p entry))
203+
(:implementation genera
204+
(let ((path (if (call-next-method)
205+
(scl:send entry :directory-pathname-as-file)
206+
entry)))
207+
(getf (cdr (ql-genera:file-properties path)) ':directory))))
199208

200209
(definterface directory-entries (directory)
201210
(:documentation "Return all directory entries of DIRECTORY as a
@@ -247,6 +256,13 @@ quicklisp at CL startup."
247256
#+ecl :resolve-symlinks #+ecl nil)
248257
(directory (merge-pathnames *wild-relative* directory)
249258
#+ecl :resolve-symlinks #+ecl nil)))
259+
(:implementation genera
260+
(let ((entries (ql-genera:directory-list (merge-pathnames *wild-entry* directory))))
261+
(loop for (pathname . properties) in (cdr entries)
262+
if (getf properties ':directory)
263+
collect (scl:send pathname :pathname-as-directory)
264+
else
265+
collect pathname)))
250266
(:implementation mezzano
251267
(directory (merge-pathnames *wild-entry* directory)))
252268
(:implementation mkcl
@@ -284,6 +300,8 @@ quicklisp at CL startup."
284300
(ql-scl:unix-rmdir (ql-scl:unix-namestring entry)))
285301
(:implementation ecl
286302
(ql-ecl:rmdir entry))
303+
(:implementation genera
304+
(ql-genera:delete-directory entry :confirm nil))
287305
(:implementation mkcl
288306
(ql-mkcl:rmdir entry))
289307
(:implementation lispworks

quicklisp/impl.lisp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,17 @@
307307
#:host-ent-address
308308
#:socket-connect
309309
#:socket-make-stream))
310+
311+
;;; Genera
312+
313+
(define-implementation-package :genera #:ql-genera
314+
(:documentation "Genera - https://github.com/SymbolicsGenera/IssuesAndWiki")
315+
(:class genera)
316+
(:reexport-from #:scl
317+
#:send)
318+
(:reexport-from #:fs
319+
#:delete-directory
320+
#:directory-list
321+
#:file-properties)
322+
(:reexport-from #:tcp
323+
#:open-tcp-stream))

quicklisp/network.lisp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898
:element-type '(unsigned-byte 8)
9999
:input t
100100
:output t
101-
:buffering :full))))
101+
:buffering :full)))
102+
(:implementation genera
103+
(ql-genera:open-tcp-stream host port nil :direction :io :characters nil)))
102104

103105
(definterface read-octets (buffer connection)
104106
(:documentation "Read from CONNECTION into BUFFER. Returns the

quicklisp/package.lisp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#:cormanlisp
5353
#:ecl
5454
#:gcl
55+
#:genera
5556
#:lispworks
5657
#:mezzano
5758
#:mkcl

quicklisp/setup.lisp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
(*print-pretty* t)
66
(*print-escape* nil)
77
(prefix (make-string indent :initial-element #\Space)))
8-
(pprint-logical-block (nil words :per-line-prefix prefix)
9-
(pprint-fill *standard-output* (sort (copy-seq words) #'string<) nil))
8+
;; Genera doesn't implement pprint-logical-block et al...
9+
#-genera (pprint-logical-block (nil words :per-line-prefix prefix)
10+
(pprint-fill *standard-output* (sort (copy-seq words) #'string<) nil))
11+
#+genera (format *standard-output* "~&~A~{~S ~}~%" prefix (sort (copy-seq words) #'string<))
1012
(fresh-line)
1113
(finish-output)))
1214

@@ -87,7 +89,7 @@
8789
:quicklisp-systems (remove-duplicates quicklisp-systems))))
8890

8991
(defun show-load-strategy (strategy)
90-
(format t "To load ~S:~%" (name strategy))
92+
(format t "~&To load ~S:~%" (name strategy))
9193
(let ((asdf-systems (asdf-systems strategy))
9294
(releases (quicklisp-releases strategy)))
9395
(when asdf-systems

0 commit comments

Comments
 (0)