The cl-interpol Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-interpol Reference Manual

This is the cl-interpol Reference Manual, version 0.2.6, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:22:09 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction


CL-INTERPOL - String interpolation for Common Lisp

CL-INTERPOL is a library for Common Lisp which modifies the reader so that you can have interpolation within strings similar to Perl or Unix Shell scripts. It also provides various ways to insert arbitrary characters into literal strings even if your editor/IDE doesn't support them. Here's an example:

(let ((a 42))
    #?"foo: \xC4\N{Latin capital letter U with diaeresis}\nbar: ${a}")
"foo: ÄÜ
bar: 42"

CL-INTERPOL comes with a BSD-style license so you can basically do with it whatever you want.

Complete documentation for CL-INTERPOL can be found in the docs directory or at the project documentation site


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-interpol

Version

0.2.6

Dependency

cl-unicode

Source

cl-interpol.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-interpol.asd

Location

cl-interpol.asd

Systems

cl-interpol (system)

Packages

cl-interpol-asd


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-interpol/packages.lisp

Parent

cl-interpol (system)

Location

packages.lisp

Packages

cl-interpol


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-interpol/specials.lisp

Dependency

packages.lisp (file)

Parent

cl-interpol (system)

Location

specials.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-interpol/util.lisp

Dependency

specials.lisp (file)

Parent

cl-interpol (system)

Location

util.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 cl-interpol/alias.lisp

Dependency

util.lisp (file)

Parent

cl-interpol (system)

Location

alias.lisp


Previous: , Up: Lisp files   [Contents][Index]

3.1.6 cl-interpol/read.lisp

Dependency

alias.lisp (file)

Parent

cl-interpol (system)

Location

read.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-interpol-asd

Source

cl-interpol.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 cl-interpol

Source

packages.lisp (file)

Nickname

interpol

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *inner-delimiters*

Legal delimiters for interpolation with #$ and #@.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *interpolate-format-directives*

Whether to allow ~X(...) as format control directives in interpolated strings.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *list-delimiter*

What is inserted between the elements of a list which is interpolated by #@.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *optional-delimiters-p*

Whether text following $ or @ should interpolate even without a following delimiter. Lexical variables are handled correctly, but the rules are somewhat complex – see the docs for details.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *outer-delimiters*

Legal outer delimiters for CL-INTERPOL strings.

Package

cl-interpol

Source

specials.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: disable-interpol-syntax ()

Restore readtable which was active before last call to ENABLE-INTERPOL-SYNTAX. If there was no such call, the standard readtable is used.

Package

cl-interpol

Source

read.lisp (file)

Macro: enable-interpol-syntax &rest %ENABLE-INTERPOL-SYNTAX-ARGS

Enable CL-INTERPOL reader syntax.

Package

cl-interpol

Source

read.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: interpol-reader *STREAM* CHAR ARG &key RECURSIVE-P

The actual reader function for the ’sub-character’ #?.

This function can be used directly outside of a read table by passing ‘recursive-p‘ as NIL.

Package

cl-interpol

Source

read.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *hyperdoc-base-uri*
Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *pair-level*
Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *previous-readtables*

A stack which holds the previous readtables that have been pushed here by ENABLE-INTERPOL-SYNTAX.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *readtable-copy*

Bound to the current readtable if it has to be temporarily modified.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *regex-delimiters*

Outer delimiters which automatically enable regex mode.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *saw-backslash*

Whether we have to re-process an L or U because it closes several scopes.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *start-char*

Bound to the opening outer delimiter while parsing a string.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *stream*

Bound to the stream which is read from while parsing a string.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *term-char*

Bound to the closing outer delimiter while parsing a string.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: *unicode-aliases*

A hash table which maps Unicode aliases to their real names.

Package

cl-interpol

Source

specials.lisp (file)

Special Variable: quell-warnings-form

A declaration form to quiet warnings about unbound variables within a lexical environment.

Package

cl-interpol

Source

read.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: defvar-unbound VARIABLE-NAME DOCUMENTATION

Like DEFVAR, but the variable will be unbound rather than getting an initial value. This is useful for variables which should have no global value but might have a dynamically bound value.

Package

cl-interpol

Source

specials.lisp (file)

Macro: peek-char* ()

Convenience macro because we always peek at the same string with the same arguments.

Package

cl-interpol

Source

util.lisp (file)

Macro: read-char* ()

Convenience macro because we always read from the same string with the same arguments.

Package

cl-interpol

Source

util.lisp (file)

Macro: signal-reader-error FORMAT-CONTROL &rest FORMAT-ARGUMENTS

Like ERROR but signals a SIMPLE-READER-ERROR for the stream *STREAM*.

Package

cl-interpol

Source

util.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: %disable-interpol-syntax ()

Internal function used to restore previous readtable.

Package

cl-interpol

Source

read.lisp (file)

Function: %enable-interpol-syntax &key MODIFY-*READTABLE*

Internal function used to enable reader syntax and store current readtable on stack.

Package

cl-interpol

Source

read.lisp (file)

Function: copy-readtable* ()

Returns a copy of the readtable which was current when INTERPOL-READER was invoked. Memoizes its result.

Package

cl-interpol

Source

util.lisp (file)

Function: get-char-from-unicode-name ()

Parses and returns a named character after "\N" has already been read. This function reads from *STREAM*.

Package

cl-interpol

Source

read.lisp (file)

Function: get-end-delimiter START-DELIMITER DELIMITERS &key ERRORP

Find the closing delimiter corresponding to the opening delimiter START-DELIMITER in a list DELIMITERS which is formatted like *OUTER-DELIMITERS*. If ERRORP is true, signal an error if none was found, otherwise return NIL.

Package

cl-interpol

Source

util.lisp (file)

Function: get-number &key RADIX MAX

Reads and consumes the number *STREAM* is currently looking at and returns it. Returns NIL if no number could be identified. RADIX is used as in PARSE-INTEGER. If MAX is not NIL we’ll read at most the next MAX characters.

Package

cl-interpol

Source

read.lisp (file)

Function: hyperdoc-lookup SYMBOL TYPE
Package

cl-interpol

Source

specials.lisp (file)

Function: inner-reader REGEX-MODE EXTENDED-MODE QUOTE-MODE CASE-MODE &key RECURSIVE-P

Helper function for INTERPOL-READER which does all the work. May call itself recursively.

Package

cl-interpol

Source

read.lisp (file)

Function: lower-case-p* CHAR

Whether CHAR is a character which has case and is lowercase.

Package

cl-interpol

Source

util.lisp (file)

Function: make-char-from-code NUMBER

Create character from char-code NUMBER. NUMBER can be NIL which is interpreted as 0.

Package

cl-interpol

Source

util.lisp (file)

Function: make-collector ()

Create an empty string which can be extended by VECTOR-PUSH-EXTEND.

Package

cl-interpol

Source

util.lisp (file)

Function: never-name-char-p C
Package

cl-interpol

Source

read.lisp (file)

Function: normal-name-char-p C
Package

cl-interpol

Source

read.lisp (file)

Function: nsubvec SEQUENCE START &optional END

Return a subvector by pointing to location in original vector.

Package

cl-interpol

Source

util.lisp (file)

Function: read-form &key RECURSIVE-P

Reads and returns one or more Lisp forms from *STREAM* if the character we’re looking at is a valid inner delimiter. Otherwise returns NIL.

Package

cl-interpol

Source

read.lisp (file)

Function: read-format-directive ()

Reads and returns a format directive (as a string) along with one or more lisp forms (as per read-form).

Package

cl-interpol

Source

read.lisp (file)

Function: read-longest-name ()
Package

cl-interpol

Source

read.lisp (file)

Function: read-optional-delimited ()

Read the stuff following an optional delimiter, returning a form that tries to deal correctly with lexical variables.

Package

cl-interpol

Source

read.lisp (file)

Function: read-while PREDICATE &key MAX

Reads characters from *STREAM* while PREDICATE returns a true value for each character. Returns at most MAX characters if MAX is true.

Package

cl-interpol

Source

read.lisp (file)

Function: resolve-unicode-name NAME

Tries to return a character which was encoded as \N<NAME>.

Package

cl-interpol

Source

read.lisp (file)

Function: string-list-to-string STRING-LIST

Concatenates a list of strings to one string.

Package

cl-interpol

Source

util.lisp (file)

Function: unescape-char REGEX-MODE

Convert the characters(s) on *STREAM* following a backslash into a character which is returned. This function is to be called when the backslash has already been consumed.

Package

cl-interpol

Source

read.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Conditions

Condition: simple-reader-error ()

A reader error which can be signalled by ERROR.

Package

cl-interpol

Source

util.lisp (file)

Direct superclasses
  • reader-error (condition)
  • simple-condition (condition)

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-interpol.asd: The cl-interpol<dot>asd file
cl-interpol/alias.lisp: The cl-interpol/alias<dot>lisp file
cl-interpol/packages.lisp: The cl-interpol/packages<dot>lisp file
cl-interpol/read.lisp: The cl-interpol/read<dot>lisp file
cl-interpol/specials.lisp: The cl-interpol/specials<dot>lisp file
cl-interpol/util.lisp: The cl-interpol/util<dot>lisp file

F
File, Lisp, cl-interpol.asd: The cl-interpol<dot>asd file
File, Lisp, cl-interpol/alias.lisp: The cl-interpol/alias<dot>lisp file
File, Lisp, cl-interpol/packages.lisp: The cl-interpol/packages<dot>lisp file
File, Lisp, cl-interpol/read.lisp: The cl-interpol/read<dot>lisp file
File, Lisp, cl-interpol/specials.lisp: The cl-interpol/specials<dot>lisp file
File, Lisp, cl-interpol/util.lisp: The cl-interpol/util<dot>lisp file

L
Lisp File, cl-interpol.asd: The cl-interpol<dot>asd file
Lisp File, cl-interpol/alias.lisp: The cl-interpol/alias<dot>lisp file
Lisp File, cl-interpol/packages.lisp: The cl-interpol/packages<dot>lisp file
Lisp File, cl-interpol/read.lisp: The cl-interpol/read<dot>lisp file
Lisp File, cl-interpol/specials.lisp: The cl-interpol/specials<dot>lisp file
Lisp File, cl-interpol/util.lisp: The cl-interpol/util<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %  
C   D   E   F   G   H   I   L   M   N   P   R   S   U  
Index Entry  Section

%
%disable-interpol-syntax: Internal functions
%enable-interpol-syntax: Internal functions

C
copy-readtable*: Internal functions

D
defvar-unbound: Internal macros
disable-interpol-syntax: Exported macros

E
enable-interpol-syntax: Exported macros

F
Function, %disable-interpol-syntax: Internal functions
Function, %enable-interpol-syntax: Internal functions
Function, copy-readtable*: Internal functions
Function, get-char-from-unicode-name: Internal functions
Function, get-end-delimiter: Internal functions
Function, get-number: Internal functions
Function, hyperdoc-lookup: Internal functions
Function, inner-reader: Internal functions
Function, interpol-reader: Exported functions
Function, lower-case-p*: Internal functions
Function, make-char-from-code: Internal functions
Function, make-collector: Internal functions
Function, never-name-char-p: Internal functions
Function, normal-name-char-p: Internal functions
Function, nsubvec: Internal functions
Function, read-form: Internal functions
Function, read-format-directive: Internal functions
Function, read-longest-name: Internal functions
Function, read-optional-delimited: Internal functions
Function, read-while: Internal functions
Function, resolve-unicode-name: Internal functions
Function, string-list-to-string: Internal functions
Function, unescape-char: Internal functions

G
get-char-from-unicode-name: Internal functions
get-end-delimiter: Internal functions
get-number: Internal functions

H
hyperdoc-lookup: Internal functions

I
inner-reader: Internal functions
interpol-reader: Exported functions

L
lower-case-p*: Internal functions

M
Macro, defvar-unbound: Internal macros
Macro, disable-interpol-syntax: Exported macros
Macro, enable-interpol-syntax: Exported macros
Macro, peek-char*: Internal macros
Macro, read-char*: Internal macros
Macro, signal-reader-error: Internal macros
make-char-from-code: Internal functions
make-collector: Internal functions

N
never-name-char-p: Internal functions
normal-name-char-p: Internal functions
nsubvec: Internal functions

P
peek-char*: Internal macros

R
read-char*: Internal macros
read-form: Internal functions
read-format-directive: Internal functions
read-longest-name: Internal functions
read-optional-delimited: Internal functions
read-while: Internal functions
resolve-unicode-name: Internal functions

S
signal-reader-error: Internal macros
string-list-to-string: Internal functions

U
unescape-char: Internal functions

Jump to:   %  
C   D   E   F   G   H   I   L   M   N   P   R   S   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
Q   S  
Index Entry  Section

*
*hyperdoc-base-uri*: Internal special variables
*inner-delimiters*: Exported special variables
*interpolate-format-directives*: Exported special variables
*list-delimiter*: Exported special variables
*optional-delimiters-p*: Exported special variables
*outer-delimiters*: Exported special variables
*pair-level*: Internal special variables
*previous-readtables*: Internal special variables
*readtable-copy*: Internal special variables
*regex-delimiters*: Internal special variables
*saw-backslash*: Internal special variables
*start-char*: Internal special variables
*stream*: Internal special variables
*term-char*: Internal special variables
*unicode-aliases*: Internal special variables

Q
quell-warnings-form: Internal special variables

S
Special Variable, *hyperdoc-base-uri*: Internal special variables
Special Variable, *inner-delimiters*: Exported special variables
Special Variable, *interpolate-format-directives*: Exported special variables
Special Variable, *list-delimiter*: Exported special variables
Special Variable, *optional-delimiters-p*: Exported special variables
Special Variable, *outer-delimiters*: Exported special variables
Special Variable, *pair-level*: Internal special variables
Special Variable, *previous-readtables*: Internal special variables
Special Variable, *readtable-copy*: Internal special variables
Special Variable, *regex-delimiters*: Internal special variables
Special Variable, *saw-backslash*: Internal special variables
Special Variable, *start-char*: Internal special variables
Special Variable, *stream*: Internal special variables
Special Variable, *term-char*: Internal special variables
Special Variable, *unicode-aliases*: Internal special variables
Special Variable, quell-warnings-form: Internal special variables

Jump to:   *  
Q   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-interpol: The cl-interpol system
cl-interpol: The cl-interpol package
cl-interpol-asd: The cl-interpol-asd package
Condition, simple-reader-error: Internal conditions

P
Package, cl-interpol: The cl-interpol package
Package, cl-interpol-asd: The cl-interpol-asd package

S
simple-reader-error: Internal conditions
System, cl-interpol: The cl-interpol system

Jump to:   C   P   S