From 95a7b920ac1214702d58fd60019daabcd68a94a8 Mon Sep 17 00:00:00 2001 From: "Walton, Izaak (VEN)" Date: Mon, 25 Sep 2023 15:50:41 -0700 Subject: [PATCH] Added Ord Cell instance --- library/cell.lisp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/cell.lisp b/library/cell.lisp index 58ed5c01d..42dafa6ab 100644 --- a/library/cell.lisp +++ b/library/cell.lisp @@ -108,6 +108,13 @@ (define (== c1 c2) (== (read c1) (read c2)))) + (define-instance (Ord :a => Ord (Cell :a)) + (define (<=> c1 c2) + (match (<=> (read c1) (read c2)) + ((LT) LT) + ((GT) GT) + ((EQ) EQ)))) + (define-instance (Num :a => Num (Cell :a)) (define (+ c1 c2) (new (+ (read c1) (read c2))))