The trivial-escapes Reference Manual

Table of Contents

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

The trivial-escapes Reference Manual

This is the trivial-escapes Reference Manual, version 1.2.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:41:23 2018 GMT+0.


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

1 Introduction

TRIVIAL-ESCAPES Quicklisp License Build Status Coverage Status

Copyright (c) 2017 William Yao

Description and usage

Ever been annoyed by the fact that Common Lisp doesn't interpret escape characters the same way that literally every other programming language does? Hey, me too!

So I wrote this library.

It provides a readtable (four, actually) that lets you write strings like this:

CL-USER> #"This string has\na newline in it!"
"This string has
a newline in it!"

CL-USER> #"\x4E00\x751F\x61F8\x547D"
"一生懸命"

Fun! To use it, use one of the exported readtables. In most cases, TRIVIAL-ESCAPES:READTABLE is probably the one you want, containing the standard readtable, with a dispatch function for #\# #\" added in.

(named-readtables:in-readtable trivesc:readtable)

However, if you need them, there are three other provided readtables as well. TRIVIAL-ESCAPES:READTABLE-MIXIN contains just the dispatch function for #\# #\" (this means that it doesn't contain any other reader macros! as in, #\( will no longer start s-expressions, for example.), and similarly, TRIVIAL-ESCAPES:DQ-READTABLE-MIXIN contains just a reader macro for #\", replacing the normal string reading.

TRIVIAL-ESCAPES:READTABLE and TRIVIAL-ESCAPES:DQ-READTABLE simple fuse the standard readtable with their respective mixins, creating actually usable readtables. In most cases, one of these two is what you want.

TRIVIAL-ESCAPES contains all the standard C escapes sequences, shown here.

Note that as a technicality, the characters you end up with will depend upon whatever character encoding your Lisp environment uses. But since everyone seems to be standardizing on Unicode, this probably won't be a p


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 trivial-escapes

Maintainer

William Yao <williamyaoh@gmail.com>

Author

William Yao <williamyaoh@gmail.com>

License

Public Domain

Description

C-style escape directives for Common Lisp.

Version

1.2.0

Dependency

named-readtables

Source

trivial-escapes.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 trivial-escapes.asd

Location

trivial-escapes.asd

Systems

trivial-escapes (system)


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

3.1.2 trivial-escapes/packages.lisp

Parent

trivial-escapes (system)

Location

packages.lisp

Packages

trivial-escapes


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

3.1.3 trivial-escapes/to-char.lisp

Dependency

packages.lisp (file)

Parent

trivial-escapes (system)

Location

to-char.lisp

Exported Definitions

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

3.1.4 trivial-escapes/escaping-pains.lisp

Dependency

to-char.lisp (file)

Parent

trivial-escapes (system)

Location

escaping-pains.lisp

Internal Definitions

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

3.1.5 trivial-escapes/readtable.lisp

Dependency

escaping-pains.lisp (file)

Parent

trivial-escapes (system)

Location

readtable.lisp


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

4 Packages

Packages are listed by definition order.


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

4.1 trivial-escapes

Source

packages.lisp (file)

Nickname

trivesc

Use List

common-lisp

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 Functions

Function: to-char CODE

CODE-CHAR, except more portable across implementations.
Signals a correctable error of type NO-SUCH-CHAR-ERROR if CODE does
not correspond to a valid character under the implementation’s character encoding.

Provides a USE-VALUE restart for the user to provide a different character.

Package

trivial-escapes

Source

to-char.lisp (file)


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

5.1.2 Generic functions

Generic Function: code CONDITION
Generic Function: (setf code) NEW-VALUE CONDITION
Package

trivial-escapes

Methods
Method: code (CONDITION no-such-char-error)
Method: (setf code) NEW-VALUE (CONDITION no-such-char-error)
Source

to-char.lisp (file)


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

5.1.3 Conditions

Condition: no-such-char-error ()
Package

trivial-escapes

Source

to-char.lisp (file)

Direct superclasses

error (condition)

Direct methods
  • print-object (method)
  • code (method)
  • code (method)
Direct slots
Slot: code
Initargs

:code

Readers

code (generic function)

Writers

(setf code) (generic function)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *escape-functions*
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Special Variable: *octal-escapes*
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Special Variable: *simple-escapes*
Package

trivial-escapes

Source

escaping-pains.lisp (file)


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

5.2.2 Macros

Macro: admit CONDITION FORM ELSE
Package

trivial-escapes

Source

escaping-pains.lisp (file)


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

5.2.3 Functions

Function: hex-digit-char-p CHAR
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Function: hex-read STREAM
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Function: octal-digit-char-p CHAR
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Function: octal-reader CHAR
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Function: read-string-escaping STREAM CHAR &optional NUMARG
Package

trivial-escapes

Source

escaping-pains.lisp (file)

Function: simple-escape CHAR

Used for implementing easy escape sequences, like backslash-n.

Package

trivial-escapes

Source

escaping-pains.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, trivial-escapes.asd: The trivial-escapes<dot>asd file
File, Lisp, trivial-escapes/escaping-pains.lisp: The trivial-escapes/escaping-pains<dot>lisp file
File, Lisp, trivial-escapes/packages.lisp: The trivial-escapes/packages<dot>lisp file
File, Lisp, trivial-escapes/readtable.lisp: The trivial-escapes/readtable<dot>lisp file
File, Lisp, trivial-escapes/to-char.lisp: The trivial-escapes/to-char<dot>lisp file

L
Lisp File, trivial-escapes.asd: The trivial-escapes<dot>asd file
Lisp File, trivial-escapes/escaping-pains.lisp: The trivial-escapes/escaping-pains<dot>lisp file
Lisp File, trivial-escapes/packages.lisp: The trivial-escapes/packages<dot>lisp file
Lisp File, trivial-escapes/readtable.lisp: The trivial-escapes/readtable<dot>lisp file
Lisp File, trivial-escapes/to-char.lisp: The trivial-escapes/to-char<dot>lisp file

T
trivial-escapes.asd: The trivial-escapes<dot>asd file
trivial-escapes/escaping-pains.lisp: The trivial-escapes/escaping-pains<dot>lisp file
trivial-escapes/packages.lisp: The trivial-escapes/packages<dot>lisp file
trivial-escapes/readtable.lisp: The trivial-escapes/readtable<dot>lisp file
trivial-escapes/to-char.lisp: The trivial-escapes/to-char<dot>lisp file

Jump to:   F   L   T  

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

A.2 Functions

Jump to:   (  
A   C   F   G   H   M   O   R   S   T  
Index Entry  Section

(
(setf code): Exported generic functions
(setf code): Exported generic functions

A
admit: Internal macros

C
code: Exported generic functions
code: Exported generic functions

F
Function, hex-digit-char-p: Internal functions
Function, hex-read: Internal functions
Function, octal-digit-char-p: Internal functions
Function, octal-reader: Internal functions
Function, read-string-escaping: Internal functions
Function, simple-escape: Internal functions
Function, to-char: Exported functions

G
Generic Function, (setf code): Exported generic functions
Generic Function, code: Exported generic functions

H
hex-digit-char-p: Internal functions
hex-read: Internal functions

M
Macro, admit: Internal macros
Method, (setf code): Exported generic functions
Method, code: Exported generic functions

O
octal-digit-char-p: Internal functions
octal-reader: Internal functions

R
read-string-escaping: Internal functions

S
simple-escape: Internal functions

T
to-char: Exported functions

Jump to:   (  
A   C   F   G   H   M   O   R   S   T  

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

A.3 Variables

Jump to:   *  
C   S  
Index Entry  Section

*
*escape-functions*: Internal special variables
*octal-escapes*: Internal special variables
*simple-escapes*: Internal special variables

C
code: Exported conditions

S
Slot, code: Exported conditions
Special Variable, *escape-functions*: Internal special variables
Special Variable, *octal-escapes*: Internal special variables
Special Variable, *simple-escapes*: Internal special variables

Jump to:   *  
C   S  

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

A.4 Data types

Jump to:   C   N   P   S   T  
Index Entry  Section

C
Condition, no-such-char-error: Exported conditions

N
no-such-char-error: Exported conditions

P
Package, trivial-escapes: The trivial-escapes package

S
System, trivial-escapes: The trivial-escapes system

T
trivial-escapes: The trivial-escapes system
trivial-escapes: The trivial-escapes package

Jump to:   C   N   P   S   T