From: Christopher Allan Webber Date: Fri, 20 Nov 2015 17:14:57 +0000 (-0600) Subject: Remove unused port handling stuff X-Git-Tag: v0.1.0~130 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5766ad69cacb52a8a0705ae9279ec64f45e9aa31;p=8sync.git Remove unused port handling stuff --- diff --git a/loopy.scm b/loopy.scm index 8c216ee..603a75a 100644 --- a/loopy.scm +++ b/loopy.scm @@ -307,36 +307,6 @@ Will produce (0 . 0) instead of a negative number, if needed." segments)) - -;;; Port handling -;;; ============= - -(define (make-port-mapping) - (make-hash-table)) - -(define* (port-mapping-set! port-mapping port #:optional read write except) - "Sets port-mapping for reader / writer / exception handlers" - (if (not (or read write except)) - (throw 'no-handlers-given "No handlers given for port" port)) - (hashq-set! port-mapping port - `#(,read ,write ,except))) - -(define (port-mapping-remove! port-mapping port) - (hashq-remove! port-mapping port)) - -;; TODO: This is O(n), I'm pretty sure :\ -;; ... it might be worthwhile for us to have a -;; port-mapping record that keeps a count of how many -;; handlers (maybe via a promise?) -(define (port-mapping-empty? port-mapping) - "Is this port mapping empty?" - (eq? (hash-count (const #t) port-mapping) 0)) - -(define (port-mapping-non-empty? port-mapping) - "Whether this port-mapping contains any elements" - (not (port-mapping-empty? port-mapping))) - - ;;; Request to run stuff ;;; ====================