From afc0b965029103f68ad867a047974af0dea153ec Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 15 Mar 2018 22:52:45 -0700 Subject: [PATCH] Change pathname representation to be a fasdumpable record. --- src/runtime/pathname.scm | 43 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/runtime/pathname.scm b/src/runtime/pathname.scm index 9c7273eab..4044a9522 100644 --- a/src/runtime/pathname.scm +++ b/src/runtime/pathname.scm @@ -97,24 +97,24 @@ these rules: |# -(define-structure (pathname - (type vector) - (named '|#[(runtime pathname)pathname]|) - (constructor %make-pathname) - (conc-name %pathname-) - (print-procedure - (simple-unparser-method 'PATHNAME - (lambda (pathname) - (list (->namestring pathname)))))) - (host #f read-only #t) - (device #f read-only #t) - (directory #f read-only #t) - (name #f read-only #t) - (type #f read-only #t) - (version #f read-only #t)) +(define-record-type + (%make-pathname host device directory name type version) + pathname? + (host %pathname-host) + (device %pathname-device) + (directory %pathname-directory) + (name %pathname-name) + (type %pathname-type) + (version %pathname-version)) +(set-record-type-fasdumpable! record-type-proxy:pathname) (define-guarantee pathname "pathname") +(define-unparser-method pathname? + (simple-unparser-method 'pathname + (lambda (pathname) + (list (->namestring pathname))))) + (define pathname-parser-method (simple-parser-method (lambda (objects) @@ -561,13 +561,12 @@ these rules: (operation/init-file-pathname #f read-only #t) (operation/pathname-simplify #f read-only #t)) -(define-structure (host (type vector) - (named ((ucode-primitive string->symbol) - "#[(runtime pathname)host]")) - (constructor %make-host) - (conc-name host/)) - (type-index #f read-only #t) - (name #f read-only #t)) +(define-record-type + (%make-host type-index name) + host? + (type-index host/type-index) + (name host/name)) +(set-record-type-fasdumpable! record-type-proxy:host) (define (make-host type name) (%make-host (host-type/index type) name)) -- 2.25.1