fly the flag

main
Matthew Butterick 5 years ago
parent 1dd3aff5d3
commit 077b227f03

@ -509,7 +509,7 @@ Base class for string formats. Use @racket[x:string] to conveniently instantiate
@defconstructor[ @defconstructor[
([len length-resolvable?] ([len length-resolvable?]
[encoding supported-encoding?])]{ [encoding (or/c procedure? supported-encoding?)])]{
Create class instance that represents a string format of length @racket[len]. If @racket[len] is an integer, the string is fixed at that length, otherwise it can be any length. Create class instance that represents a string format of length @racket[len]. If @racket[len] is an integer, the string is fixed at that length, otherwise it can be any length.
} }
@ -544,9 +544,9 @@ Whether @racket[x] is an object of type @racket[x:string%].
@defproc[ @defproc[
(x:string (x:string
[len-arg (or/c length-resolvable? #false) #false] [len-arg (or/c length-resolvable? #false) #false]
[enc-arg (or/c supported-encoding? #false) #false] [enc-arg (or/c procedure? supported-encoding? #false) #false]
[#:length len-kw (or/c length-resolvable? #false) #false] [#:length len-kw (or/c length-resolvable? #false) #false]
[#:encoding enc-kw (or/c supported-encoding? #false) #false] [#:encoding enc-kw (or/c procedure? supported-encoding? #false) #false]
[#:pre-encode pre-encode-proc (or/c (any/c . -> . any/c) #false) #false] [#:pre-encode pre-encode-proc (or/c (any/c . -> . any/c) #false) #false]
[#:post-decode post-decode-proc (or/c (any/c . -> . any/c) #false) #false] [#:post-decode post-decode-proc (or/c (any/c . -> . any/c) #false) #false]
[#:base-class base-class (λ (c) (subclass? c x:string%)) x:string%] [#:base-class base-class (λ (c) (subclass? c x:string%)) x:string%]
@ -574,7 +574,7 @@ Base class for symbol formats. Use @racket[x:symbol] to conveniently instantiate
@defconstructor[ @defconstructor[
([len length-resolvable?] ([len length-resolvable?]
[encoding supported-encoding?])]{ [encoding (or/c procedure? supported-encoding?)])]{
Create class instance that represents a symbol format of length @racket[len]. If @racket[len] is an integer, the symbol is fixed at that length, otherwise it can be any length. Create class instance that represents a symbol format of length @racket[len]. If @racket[len] is an integer, the symbol is fixed at that length, otherwise it can be any length.
} }
@ -609,9 +609,9 @@ Whether @racket[x] is an object of type @racket[x:symbol%].
@defproc[ @defproc[
(x:symbol (x:symbol
[len-arg (or/c length-resolvable? #false) #false] [len-arg (or/c length-resolvable? #false) #false]
[enc-arg (or/c supported-encoding? #false) #false] [enc-arg (or/c procedure? supported-encoding? #false) #false]
[#:length len-kw (or/c length-resolvable? #false) #false] [#:length len-kw (or/c length-resolvable? #false) #false]
[#:encoding enc-kw (or/c supported-encoding? #false) #false] [#:encoding enc-kw (or/c procedure? supported-encoding? #false) #false]
[#:pre-encode pre-encode-proc (or/c (any/c . -> . any/c) #false) #false] [#:pre-encode pre-encode-proc (or/c (any/c . -> . any/c) #false) #false]
[#:post-decode post-decode-proc (or/c (any/c . -> . any/c) #false) #false] [#:post-decode post-decode-proc (or/c (any/c . -> . any/c) #false) #false]
[#:base-class base-class (λ (c) (subclass? c x:symbol%)) x:symbol%] [#:base-class base-class (λ (c) (subclass? c x:symbol%)) x:symbol%]

@ -101,9 +101,9 @@ https://github.com/mbutterick/restructure/blob/master/src/String.coffee
#:base-class [base-class x:string%]) #:base-class [base-class x:string%])
(() (()
((or/c length-resolvable? #false) ((or/c length-resolvable? #false)
(or/c supported-encoding? #false) (or/c procedure? supported-encoding? #false)
#:length (or/c length-resolvable? #false) #:length (or/c length-resolvable? #false)
#:encoding (or/c supported-encoding? #false) #:encoding (or/c procedure? supported-encoding? #false)
#:pre-encode (or/c (any/c . -> . any/c) #false) #:pre-encode (or/c (any/c . -> . any/c) #false)
#:post-decode (or/c (any/c . -> . any/c) #false) #:post-decode (or/c (any/c . -> . any/c) #false)
#:base-class (λ (c) (subclass? c x:string%))) #:base-class (λ (c) (subclass? c x:string%)))
@ -113,7 +113,7 @@ https://github.com/mbutterick/restructure/blob/master/src/String.coffee
(unless (length-resolvable? len) (unless (length-resolvable? len)
(raise-argument-error 'x:string "resolvable length" len)) (raise-argument-error 'x:string "resolvable length" len))
(define encoding (or enc-arg enc-kwarg 'ascii)) (define encoding (or enc-arg enc-kwarg 'ascii))
(unless (supported-encoding? encoding) (unless (or (supported-encoding? encoding) (procedure? encoding))
(raise-argument-error 'x:string "valid encoding value" encoding)) (raise-argument-error 'x:string "valid encoding value" encoding))
(new (generate-subclass base-class pre-proc post-proc) (new (generate-subclass base-class pre-proc post-proc)
[len len] [len len]

@ -30,9 +30,9 @@
#:base-class [base-class x:symbol%]) #:base-class [base-class x:symbol%])
(() (()
((or/c length-resolvable? #false) ((or/c length-resolvable? #false)
(or/c supported-encoding? #false) (or/c procedure? supported-encoding? #false)
#:length (or/c length-resolvable? #false) #:length (or/c length-resolvable? #false)
#:encoding (or/c supported-encoding? #false) #:encoding (or/c procedure? supported-encoding? #false)
#:pre-encode (or/c (any/c . -> . any/c) #false) #:pre-encode (or/c (any/c . -> . any/c) #false)
#:post-decode (or/c (any/c . -> . any/c) #false) #:post-decode (or/c (any/c . -> . any/c) #false)
#:base-class (λ (c) (subclass? c x:symbol%))) #:base-class (λ (c) (subclass? c x:symbol%)))
@ -42,7 +42,7 @@
(unless (length-resolvable? len) (unless (length-resolvable? len)
(raise-argument-error 'x:symbol "resolvable length" len)) (raise-argument-error 'x:symbol "resolvable length" len))
(define encoding (or enc-arg enc-kwarg 'utf8)) (define encoding (or enc-arg enc-kwarg 'utf8))
(unless (supported-encoding? encoding) (unless (or (supported-encoding? encoding) (procedure? encoding))
(raise-argument-error 'x:symbol "valid encoding value" encoding)) (raise-argument-error 'x:symbol "valid encoding value" encoding))
(new (generate-subclass base-class pre-proc post-proc) (new (generate-subclass base-class pre-proc post-proc)
[len len] [len len]

Loading…
Cancel
Save