X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=loopy.scm;fp=loopy.scm;h=603a75a47e19afc1be2208530ce05b0d9a078a26;hp=8c216eeb7d1dd509d50846b76bf6ca510c682c4d;hb=5766ad69cacb52a8a0705ae9279ec64f45e9aa31;hpb=f04065ae644b415fdf14564aec4be0c6f6189988 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 ;;; ====================