ffi: Avoid 9.1's expansion of define-print-method.
authorMatt Birkholz <matt@birchwood-abbey.net>
Tue, 3 Jul 2018 15:05:37 +0000 (10:05 -0500)
committerMatt Birkholz <matt@birchwood-abbey.net>
Tue, 3 Jul 2018 15:05:37 +0000 (10:05 -0500)
src/runtime/ffi.scm

index 3be4c1d32ea627ea87516ecf1851afe9035d2263..5799e4a539b9e58cc94b58f8bb235d9eb2003f0a 100644 (file)
@@ -35,7 +35,16 @@ USA.
 (define-structure (alien (constructor %make-alien)
                         (conc-name %alien/)
                         (copier copy-alien)
-                        (predicate alien?))
+                        (predicate alien?)
+                        (print-procedure
+                         (bracketed-print-method
+                          'alien
+                          (lambda (alien port)
+                            (write-char #\space port)
+                            (write (%alien/ctype alien) port)
+                            (write-string " 0x" port)
+                            (write-string (alien/address-string alien)
+                                          port)))))
   ;; Two fixnums.
   (high-bits 0) (low-bits 0)
   ;; A symbol or list.
@@ -45,15 +54,6 @@ USA.
 ;; two digits representing a larger number, then RADIX is their base.
 (define %radix)
 
-(define-print-method alien?
-  (bracketed-print-method
-   'alien
-   (lambda (alien port)
-     (write-char #\space port)
-     (write (%alien/ctype alien) port)
-     (write-string " 0x" port)
-     (write-string (alien/address-string alien) port))))
-
 (define-integrable alien/ctype %alien/ctype)
 
 (define-integrable set-alien/ctype! set-%alien/ctype!)