From a08683819191f12fd7380373ab823ebc246825d7 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 7 Feb 2023 08:30:01 -0500 Subject: Rename struct predicate. --- chickadee/graphics/seagull.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm index ce1a686..0ddbbfb 100644 --- a/chickadee/graphics/seagull.scm +++ b/chickadee/graphics/seagull.scm @@ -1162,8 +1162,8 @@ (predicate:substitute from to))) subs))) -(define (predicate:struct-has? struct field var) - `(struct-has? ,struct ,field ,var)) +(define (predicate:struct-field struct field var) + `(struct-field ,struct ,field ,var)) (define (predicate:array-element array var) `(array-element ,array ,var)) @@ -1207,8 +1207,8 @@ (('substitute a b) `(substitute ,(apply-substitution-to-type a from to) ,(apply-substitution-to-type b from to))) - (('struct-has? struct field var) - `(struct-has? ,(apply-substitution-to-type struct from to) + (('struct-field struct field var) + `(struct-field ,(apply-substitution-to-type struct from to) ,field ,(apply-substitution-to-type var from to))) (('array-element array var) @@ -1377,7 +1377,7 @@ (values #t (list (cons a b)))) ;; Substitute the field var when struct has been resolved to a ;; struct type. - (('struct-has? struct field field-var) + (('struct-field struct field field-var) (if (struct-type? struct) (values #t (list (cons field-var (struct-type-ref struct field)))) (values pred '()))) @@ -1469,7 +1469,7 @@ (('substitute a b) (append (free-variables-in-type a) (free-variables-in-type b))) - (('struct-has? struct field var) + (('struct-field struct field var) (append (free-variables-in-type struct) (free-variables-in-type var))) (('array-element array var) @@ -1752,7 +1752,7 @@ `(struct-ref ,exp* ,field)) exp-subs (compose-predicates exp-pred - (predicate:struct-has? exp-type field tvar)))) + (predicate:struct-field exp-type field tvar)))) (define (infer:array-ref array-exp index-exp env) (define-values (array-exp* array-exp-subs array-exp-pred) @@ -2139,7 +2139,7 @@ (list (list (cons from to)))) (('= a b) (list (list (cons a b)))) - (('struct-has? struct-var field field-var) + (('struct-field struct-var field field-var) (filter-map (lambda (struct) (let ((field-type (struct-type-ref struct field))) (and field-type -- cgit v1.2.3