From fab6610fb1f75c9de02a2c1676a19ba845df5185 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 28 Sep 2021 08:58:00 -0400 Subject: math: rect: Add custom record type printer. --- chickadee/math/rect.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chickadee/math/rect.scm b/chickadee/math/rect.scm index 3ccaf97..690d779 100644 --- a/chickadee/math/rect.scm +++ b/chickadee/math/rect.scm @@ -16,9 +16,11 @@ ;;; . (define-module (chickadee math rect) + #:use-module (ice-9 format) #:use-module (rnrs bytevectors) #:use-module (srfi srfi-4) #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) #:use-module (chickadee math) #:use-module (chickadee math vector) #:export (make-rect @@ -81,6 +83,12 @@ rect? (bv unwrap-rect)) +(define (display-rect rect port) + (format port "#" + (rect-x rect) (rect-y rect) (rect-width rect) (rect-height rect))) + +(set-record-type-printer! display-rect) + (define (make-null-rect) (wrap-rect (make-f32vector 4 0.0))) -- cgit v1.2.3