From d40455d82459030ad54958f03fc82b53b5e8da20 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Fri, 9 Oct 2026 18:10:24 +0300 Subject: [PATCH] read the compared distances through the casts A cast as the object of `.' keeps its parentheses now (sex#61), so the comparator takes the two distances straight from its arguments. Co-Authored-By: Claude Opus 5.5 --- src/search.sex | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/search.sex b/src/search.sex index ac982c7..67e82b8 100644 --- a/src/search.sex +++ b/src/search.sex @@ -47,11 +47,9 @@ (record region-order ((rx int) (rz int) (distance double))) (fn by-distance ((pa (* const void)) (pb (* const void))) int - ;; TODO sex#61: cast inside the field access once a cast as the object - ;; of . keeps its parentheses. - (var a (* const region-order) pa) - (var b (* const region-order) pb) - (return (- (> (. a distance) (. b distance)) (< (. a distance) (. b distance))))) + (var a _ (. (cast pa (* const region-order)) distance)) + (var b _ (. (cast pb (* const region-order)) distance)) + (return (- (> a b) (< a b)))) ;;; A thread's generators, and the searched mineral's ore map of the ;;; region it last scanned in.