On this page:
top
up

1Common PredicatesπŸ”— i

Many control codes accept parameters which are either numeric values or ASCII characters. The following predicates are used for parameter checking.

value

char-ascii/c :flat-contract?

Ensures a character is in the range of the 7-bit ASCII character set.

value

code-param/c :flat-contract?

Ensures a numeric value in the range of an 8-bit unsigned byte.

value

code-param-list/c :contract?

Ensures either a single code-param/c value or a list of code-param/c values.

This value is the separator character used to print a list of parameters with code-param-list->string .

procedure

( code-param->string val)string?

Convert a single code-param/c to a string.

Examples:

"22"

"7"

code-param->string: contract violation

expected: (<=/c 127)

given: 955

in: an and/c case of

the 1st argument of

(->

(and/c

natural-number/c

(>=/c 0)

(<=/c 127))

string?)

contract from: <pkgs>/ansi-terminal/main.rkt

blaming: top-level

(assuming the contract is correct)

at: <pkgs>/ansi-terminal/main.rkt:11:24

procedure

( code-param-list->string val)string?

Convert a code-param-list/c to a string.

Examples:

"22;34"

"41"

"46"

code-param-list->string: contract violation

expected: (or/c (and/c natural-number/c (>=/c 0) (<=/c

127)) (listof (and/c natural-number/c (>=/c 0) (<=/c 127))))

given: 955

in: the 1st argument of

(->

(or/c

(and/c

natural-number/c

(>=/c 0)

(<=/c 127))

(listof

(and/c

natural-number/c

(>=/c 0)

(<=/c 127))))

string?)

contract from: <pkgs>/ansi-terminal/main.rkt

blaming: top-level

(assuming the contract is correct)

at: <pkgs>/ansi-terminal/main.rkt:12:24

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /