==================================================================== _quasistring.ss_; _quasistring_ ==================================================================== Abstract ------------------------------------------------------- The quasistring package provides convenient syntax for constructing strings that include computed values. MACROS --------------------------------------------------------- > (qs str) -> str qs requires a syntactic string as its argument. qs evaluates to the syntactic string it was provided, but with any occurrences of a dollar-sign followed by an s-expression in the string replaced by the evaluation of that s-expression in the current lexical context and converted to a string with _display_ (or by applying the value of the _current-quasistring-converter_ parameter to it). Literal dollar signs can be included in quasistrings by escaping using a double-backslash. quasistring strings preserve eq-ness across multiple evaluations of the same quasistring if the template string contains no s-expressions. PARAMETERS ---------------------------------------------------- > (current-quasistring-converter) -> any? -> void > (current-quasistring-converter any?) -> void current-quasistring-converter is a parameter that accepts any Scheme value and prints a character representation of it. The _qs_ macro uses this parameter to convert values to string form; its default value is the mzscheme _display_ procedure. ==================================================================== _qstr-lang.ss_; _quasistring language_ ==================================================================== _qstr-lang.ss_ is a wrapper for _quasistring.ss_ intended to be used as a module language (i.e., an alternative to "mzscheme" when specifying a module). All strings in modules written in qstr-lang.ss are quasistrings; the _qs_ macro is not required (nor is it provided). ==================================================================== Known Issues ==================================================================== By necessity, the quasistring library uses an approximation of the source location for the expressions inside a quasistring. This approximation assumes that programmers will use the smallest character representation of any particular character that appears in source code; for instance, it assumes that when it encounters the character 'I' that the programmer literally typed 'I' rather than \#111 or any of the other representations the character 'I' has. If a programmer does use a non-minimally-small escape code for a character inside a quasistring, syntax-location information will be incorrect for the remainder of that quasistring.