You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
401 B
Racket
11 lines
401 B
Racket
#lang restructure/racket
|
|
(provide (all-defined-out))
|
|
(require "number.rkt")
|
|
|
|
(define (resolveLength length stream parent)
|
|
(cond
|
|
[(number? length) length]
|
|
[(procedure? length) (length parent)]
|
|
[(and parent (string? length) (· parent length))]
|
|
[(and stream (is-a? length Number) (send length decode stream))]
|
|
[else (raise-argument-error 'resolveLength "fixed-size item" length)])) |