diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-02-07 08:30:01 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-06-08 08:14:41 -0400 |
commit | a08683819191f12fd7380373ab823ebc246825d7 (patch) | |
tree | 592f060c1d61f56908d993d79d6c83c59228308a | |
parent | 35b58c0524712e736f0272b9b8849c01d83bc32d (diff) |
Rename struct predicate.
-rw-r--r-- | chickadee/graphics/seagull.scm | 16 |
1 files 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 |