diff --git a/module/language/ghil.scm b/module/language/ghil.scm index 714f508bf..00a2c9afd 100644 --- a/module/language/ghil.scm +++ b/module/language/ghil.scm @@ -24,7 +24,9 @@ #:use-module (system base pmatch) #:use-module (ice-9 regex) #:export - ( make-ghil-void ghil-void? + (ghil-env ghil-loc + + make-ghil-void ghil-void? ghil-void-env ghil-void-loc make-ghil-quote ghil-quote? @@ -113,31 +115,32 @@ (define (print-ghil x port) (format port "#" (unparse-ghil x))) -(define-type ( #:printer print-ghil) +(define-type ( #:printer print-ghil + #:common-slots (env loc)) ;; Objects - ( env loc) - ( env loc obj) - ( env loc exp) - ( env loc exp) - ( env loc exp) + () + ( obj) + ( exp) + ( exp) + ( exp) ;; Variables - ( env loc var) - ( env loc var val) - ( env loc var val) + ( var) + ( var val) + ( var val) ;; Controls - ( env loc test then else) - ( env loc exps) - ( env loc exps) - ( env loc exps) - ( env loc vars vals body) - ( env loc producer vars rest body) - ( env loc vars rest meta body) - ( env loc proc args) - ( env loc producer consumer) - ( env loc inline args) - ( env loc values) - ( env loc values) - ( env loc)) + ( test then else) + ( exps) + ( exps) + ( exps) + ( vars vals body) + ( producer vars rest body) + ( vars rest meta body) + ( proc args) + ( producer consumer) + ( inline args) + ( values) + ( values) + ()) diff --git a/module/system/base/syntax.scm b/module/system/base/syntax.scm index 4382a8e66..35748bb79 100644 --- a/module/system/base/syntax.scm +++ b/module/system/base/syntax.scm @@ -50,7 +50,7 @@ `(define (,(symbol-append (trim-brackets name) '- common-slot) x) - (struct-ref x i))) + (struct-ref x ,i))) common-slots (iota (length common-slots)))))))