Search

( date->string [ date? date ] ) string? ( date->string [ date? date ] [ string? format-string ] ) string?
format-string
~~
a literal ~
~a
locale's abbreviated weekday name (Sun...Sat)
~A
locale's full weekday name (Sunday...Saturday)
~b
locale's abbreviate month name (Jan...Dec)
~B
locale's full month day (January...December)
~c
locale's date and time (e.g., "Fri Jul 14 20:28:42-0400 2000")
~d
day of month, zero padded (01...31)
~D
date (mm/dd/yy)
~e
day of month, blank padded ( 1...31)
~f
seconds+fractional seconds, using locale's decimal separator (e.g. 5.2).
~h
same as ~b
~H
hour, zero padded, 24-hour clock (00...23)
~I
hour, zero padded, 12-hour clock (01...12)
~j
day of year, zero padded
~k
hour, blank padded, 24-hour clock ( 0...23)
~l
hour, blank padded, 12-hour clock ( 1...12)
~m
month, zero padded (01...12)
~M
minute, zero padded (00...59)
~n
new line
~N
nanosecond, zero padded
~p
locale's AM or PM
~r
time, 12 hour clock, same as "~I:~M:~S ~p"
~s
number of full seconds since "the epoch" (in UTC)
~S
second, zero padded (00...60)
~t
horizontal tab
~T
time, 24 hour clock, same as "~H:~M:~S"
~U
week number of year with Sunday as first day of week (00...53)
~V
ISO 8601 week number of the year with Monday as first day of week (01..53)
~w
day of week (0...6)
~W
week number of year with Monday as first day of week (01...52)
~x
locale's date representation
~X
locale's time representation
~y
last two digits of year (00...99)
~Y
year
~z
time zone in RFC-822 style
~Z
symbol time zone (not-implemented)
~1
ISO-8601 year-month-day format
~2
ISO-8601 hour-minute-second-timezone format
~3
ISO-8601 hour-minute-second format
~4
ISO-8601 year-month-day-hour-minute-second-timezone format
~5
ISO-8601 year-month-day-hour-minute-second format
( format [ string? format-string ] obj ... ) string?
format-string
~a
The corresponding value is inserted into the string as if printed with display.
~s
The corresponding value is inserted into the string as if printed with write.
~%A
A newline is inserted.
~~
A tilde '~' is inserted.
( format [ string? format-string ] obj ... ) string? ( format [ #f port ] [ string? format-string ] obj ... ) string? ( format [ output-port? port ] [ string? format-string ] obj ... )
format-string
~a
Mnemonic: Any. Action: (display obj) for humans. Consumes: yes
~s
Mnemonic: Slashified. Action: (write obj) for parsers. Consumes: yes
~w
Mnemonic: WriteCircular. Action: (write-with-shared-structure obj) like ~s, but handles recursive structures. Consumes: yes
~d
Mnemonic: Decimal. Action: the obj is a number which is output in decimal radix. Consumes: yes
~x
Mnemonic: heXadecimal. Action: the obj is a number which is output in hexdecimal radix. Consumes: yes
~o
Mnemonic: Octal. Action: the obj is a number which is output in octal radix. Consumes: yes
~b
Mnemonic: Binary. Action: the obj is a number which is output in binary radix. Consumes: yes
~c
Mnemonic: Character. Action: the single charater obj is output by write-char. Consumes: yes
~y
Mnemonic: Yuppify. Action: the list obj is pretty-printed to the output. Consumes: yes
~?
Mnemonic: Indirection. Action: the obj is another format-string and the following obj is a list of arguments; format is called recursively. Consumes: yes
~K
Mnemonic: Indirection. Action: the same as ~? for backward compatability with some existing implementations. Consumes: yes
~[w[,d]]F
Mnemonic: Fixed. Action: ~w,dF outputs a number with width w and d digits after the decimal; ~wF outputs a string or number with width w. Consumes: yes
~~
Mnemonic: Tilde. Action: output a tilde. Consumes: no
~t
Mnemonic: Tab. Action: output a tab character. Consumes: no
~%
Mnemonic: Newline. Action: output a newline character. Consumes: no
~&
Mnemonic: Freshline. Action: output a newline character if it is known that the previous output was not a newline. Consumes: no
~_
Mnemonic: Space. Action: a single space character is output. Consumes: no
~h
Mnemonic: Help. Action: outputs one line of call synopsis, one line of comment, and one line of synopsis for each format directive, starting with the directive (e.g. "~t"). Consumes: no
( get-environment-variable [ string? name ] ) ( or string? #f )
Many operating systems provide each running process with an environment consisting of environment variables. (This environment is not to be confused with the Scheme environments that can be passed to eval: see section 6.12.) Both the name and value of an environment variable are strings. The procedure get-environment-variable returns the value of the environment variable name, or #f if the named environment variable is not found. It may use locale information to encode the name and decode the value of the environment variable. It is an error if get-environment-variable can’t decode the value. It is also an error to mutate the resulting string.
( get-output-string [ output-port? port ] ) string?
It is an error if port was not created with open-output-string. Returns a string consisting of the characters that have been output to the port so far in the order they were output. If the result string is modified, the effect is unspecified.
( get-output-string [ output-port? port ] ) string?
It is an error if port was not created with open-output-string. Returns a string consisting of the characters that have been output to the port so far in the order they were output. If the result string is modified, the effect is unspecified.
( list->string [ list? list ] ) string?
list ' ( [ char? c ] ... )
string->list, list->string The string->list procedure returns a newly allocated list of the characters of string between start and end. list->string returns a newly allocated string formed from the elements in the list list. In both procedures, order is preserved. string->list and list->string are inverses so far as equal? is concerned.
( make-string [ integer? k ] ) string? ( make-string [ integer? k ] [ char? char ] ) string?
The make-string procedure returns a newly allocated string of length k. If char is given, then all the characters of the string are initialized to char, otherwise the contents of the string are unspecified.
( number->string [ number? z ] ) string? ( number->string [ number? z ] [ integer? radix ] ) string?
It is an error if radix is not one of 2, 8, 10, or 16. The procedure number->string takes a number and a radix and returns as a string an external representation of the given number in the given radix. It is an error if no possible result makes this expression true. If omitted, radix defaults to 10. If z is inexact, the radix is 10, and the above expression can be satisfied by a result that contains a decimal point, then the result contains a decimal point and is expressed using the minimum number of digits (exclusive of exponent and trailing zeroes) needed to make the above expression true [4, 5]; otherwise the format of the result is unspecified. The result returned by number->string never contains an explicit radix prefix. Note: The error case can occur only when z is not a complex number or is a complex number with a non-rational real or imaginary part. Rationale: If z is an inexact number and the radix is 10, then the above expression is normally satisfied by a result containing a decimal point. The unspecified case allows for infinities, NaNs, and unusual representations.
( read-line ) ( or eof-object? string? ) ( read-line [ input-port? port ] ) ( or eof-object? string? )
Returns the next line of text available from the textual input port, updating the port to point to the following character. If an end of line is read, a string containing all of the text up to (but not including) the end of line is returned, and the port is updated to point just past the end of line. If an end of file is encountered before any end of line is read, but some characters have been read, a string containing those characters is returned. If an end of file is encountered before any characters are read, an end-of-file object is returned. For the purpose of this procedure, an end of line consists of either a linefeed character, a carriage return character, or a sequence of a carriage return character followed by a linefeed character. Implementations may also recognize other end of line characters or sequences.
( sort [ vector? sequence ] [ procedure? less? ] ) vector? ( sort [ vector? sequence ] [ procedure? less? ] [ procedure? key ] ) vector? ( sort [ list? sequence ] [ procedure? less? ] ) list? ( sort [ list? sequence ] [ procedure? less? ] [ procedure? key ] ) list? ( sort [ string? sequence ] [ procedure? less? ] ) string? ( sort [ string? sequence ] [ procedure? less? ] [ procedure? key ] ) string?
less? ( λ x y ) boolean?
key ( λ obj ) *
( sort! [ vector? sequence ] [ procedure? less? ] ) vector? ( sort! [ vector? sequence ] [ procedure? less? ] [ procedure? key ] ) vector? ( sort! [ list? sequence ] [ procedure? less? ] ) list? ( sort! [ list? sequence ] [ procedure? less? ] [ procedure? key ] ) list? ( sort! [ string? sequence ] [ procedure? less? ] ) string? ( sort! [ string? sequence ] [ procedure? less? ] [ procedure? key ] ) string?
less? ( λ x y ) boolean?
key ( λ obj ) *
( string-append [ string? string ] ... ) string?
Returns a newly allocated string whose characters are the concatenation of the characters in the given strings.