diff --git a/xenomorph/xenomorph/helper.rkt b/xenomorph/xenomorph/helper.rkt index e1ca83a6..0ee715db 100644 --- a/xenomorph/xenomorph/helper.rkt +++ b/xenomorph/xenomorph/helper.rkt @@ -53,8 +53,8 @@ (define encode-result (inner (error 'xxencode-not-augmented) xxencode (pre-encode val) output-port parent)) (when (bytes? encode-result) (write-bytes encode-result output-port))) - (define/pubment (xxsize [val #f] [parent #f] . _) - (define size (inner 0 xxsize val parent)) + (define/pubment (xxsize [val #f] [parent #f] . args) + (define size (inner 0 xxsize val parent . args)) (unless (and (integer? size) (not (negative? size))) (raise-argument-error 'size "nonnegative integer" size)) size) diff --git a/xenomorph/xenomorph/test/struct-test.rkt b/xenomorph/xenomorph/test/struct-test.rkt index ea3443cb..02baba22 100644 --- a/xenomorph/xenomorph/test/struct-test.rkt +++ b/xenomorph/xenomorph/test/struct-test.rkt @@ -75,7 +75,6 @@ https://github.com/mbutterick/restructure/blob/master/test/Struct.coffee 'nameLength uint8 'name (+xstring 'nameLength) 'age uint8)) - ;(set-pre-encode! struct (λ (val) (dict-set! val 'nameLength (string-length (dict-ref val 'name))) val)) (encode struct (mhasheq 'name "roxyb" 'age 21)) (check-equal? (get-output-bytes (current-output-port)) #"\x05roxyb\x15")))