Strings and Text

Constructors

str

Constructs a string.

template-str

Constructs a string.

pretty-str

Converts GameLisp syntax into a string with appropriate whitespace.

int->str

Converts an integer to a string, with the specified radix.

flo->str

Converts a float to a string, with the specified number of digits after the decimal point.

sym

Constructs a symbol.

gensym

Constructs a unique symbol.

valid-sym-char?

Returns #t if its argument is a valid symbol character.

valid-sym-str?

Returns #t if its argument would be a valid symbol.

representable-sym-str?

Returns #t if its argument would be a valid, representable symbol.

Parsing

parse

Incrementally parses values from a string.

parse-all

Parses zero or more values from a string.

parse-1

Parses exactly one value from a string.

unparse

Losslessly converts GameLisp data into a string.

pretty-unparse

Losslessly converts GameLisp data into a string with appropriate whitespace.

Printing

pr

Prints to the standard output stream.

prn

Prints to the standard output stream, followed by a newline.

pretty-prn

Pretty-prints to the standard output stream.

epr

Prints to the standard error stream.

eprn

Prints to the standard error stream, followed by a newline.

pretty-eprn

Pretty-prints to the standard error stream.

Text

uppercase

Converts a string to uppercase.

lowercase

Converts a string to lowercase.

replace

Performs text substitution.

trim

Trims leading and trailing characters from a string.

trim-start

Trims leading characters from a string.

trim-end

Trims trailing characters from a string.

pad

Adds padding characters to the end of a string.

pad-start

Adds padding characters to the beginning of a string.

pad-end

Adds padding characters to the end of a string.

Predicates

whitespace?

Returns #t if the given character or string is whitespace.

contains?

Returns #t if a string contains a character or substring.

Collections
Iterators