From 9a6996ec5726df696bcb769efcc6118e753dbe57 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 15 Dec 2018 22:46:06 -0800 Subject: [PATCH] nit --- xenomorph/xenomorph/enum.rkt | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/xenomorph/xenomorph/enum.rkt b/xenomorph/xenomorph/enum.rkt index 3ad53399..195db8e8 100644 --- a/xenomorph/xenomorph/enum.rkt +++ b/xenomorph/xenomorph/enum.rkt @@ -7,27 +7,6 @@ approximates https://github.com/mbutterick/restructure/blob/master/src/Enum.coffee |# -#;(define/post-decode (xenum-decode xe [port-arg (current-input-port)] #:parent [parent #f]) - (define port (->input-port port-arg)) - (parameterize ([current-input-port port]) - )) - -#;(define (xenum-size xe [valĀ #f] #:parent [parent #f]) - ) - -#;(define/pre-encode (xenum-encode xe val [port-arg (current-output-port)] #:parent [parent #f]) - (define port (if (output-port? port-arg) port-arg (open-output-bytes))) - (parameterize ([current-output-port port]) - - (unless port-arg (get-output-bytes port)))) - -#;(struct xenum xbase (type options) #:transparent - #:methods gen:xenomorphic - [(define decode xenum-decode) - (define xdecode xenum-decode) - (define encode xenum-encode) - (define size xenum-size)]) - (define xenum% (class xenobase% (super-new) @@ -44,7 +23,7 @@ https://github.com/mbutterick/restructure/blob/master/src/Enum.coffee (send type xxencode index port parent)) (define/augment (xxsize [val #f] [parent #f]) - (send type xxsize)))) + (send type xxsize val parent)))) (define (+xenum [type-arg #f] [values-arg #f] #:type [type-kwarg #f]