From 3abdafa8b038b54ed3aacb0b3ba401d67d7327d9 Mon Sep 17 00:00:00 2001 From: Christine Lemmer-Webber Date: Tue, 1 Feb 2022 10:35:24 -0500 Subject: [PATCH] Add remove method to FILO queue in actor-lib This allows for removal of objects that are in the filo queue, although it is O(n) since it searches the list until it finds a result (using the traditional srfi-1 remove procedure). --- goblins/actor-lib/common.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/goblins/actor-lib/common.rkt b/goblins/actor-lib/common.rkt index 04a8580..dd1bd64 100644 --- a/goblins/actor-lib/common.rkt +++ b/goblins/actor-lib/common.rkt @@ -63,7 +63,9 @@ (car lst))] [(append new-lst) (bcom (^filo-queue bcom (append new-lst lst)))] - [(data) lst])) + [(data) lst] + [(remove item #:same? [same? equal?]) + (bcom (^filo-queue bcom (remove item lst same?)))])) (define (^set bcom [s (set)]) (methods