The mstrings Reference Manual

This is the mstrings Reference Manual, version 0.1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:07:08 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 mstrings

Pretty multiline strings Reader Macro

Author

Samuel Hunter

Contact

Home Page

https://sr.ht/~shunter/mstrings/

Source Control

(GIT https://git.sr.ht/~shunter/mstrings/)

Bug Tracker

https://todo.sr.ht/~shunter/mstrings/

License

BSD 3-Clause

Long Description

Mstrings defines a reader macro for strings with a small handful of features to provide visually appealing multiline blocks.

Version

0.1.1

Dependency

named-readtables (system).

Source

mstrings.asd.

Child Component

mstrings.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 mstrings/mstrings.asd

Source

mstrings.asd.

Parent Component

mstrings (system).

ASDF Systems

mstrings.


3.1.2 mstrings/mstrings.lisp

Source

mstrings.asd.

Parent Component

mstrings (system).

Packages

xyz.shunter.mstrings.

Public Interface

mstring-reader (function).

Internals

4 Packages

Packages are listed by definition order.


4.1 xyz.shunter.mstrings

Reader macro for friendlier multiline strings

Source

mstrings.lisp.

Nickname

mstrings

Use List

common-lisp.

Public Interface

mstring-reader (function).

Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: mstring-reader (stream subchar arg)

Multiline string reader function to be installed as a dispatching macro character.
It ignores and warns on any provided ARG, and provides a few quality-of-life features depending on the value of SUBCHAR:

- If SUBCHAR is #\", it is always literal-block mode (‘#M"..."‘) and reads the rest of the string.
- If SUBCHAR is #\>, it is always folding-block mode (‘#M>"..."‘).
- If SUBCHAR is anything else, it reverts to its default behavior: it assumes literal-block mode unless there is a greater-than-sign preceding the string, in which case it switches to folding-block mode.

Package

xyz.shunter.mstrings.

Source

mstrings.lisp.


5.2 Internals


5.2.1 Macros

Macro: do@ (varlist endlist &body body)

Anaphoric DO. An @ in the then-form replays the init-form.

Package

xyz.shunter.mstrings.

Source

mstrings.lisp.


5.2.2 Ordinary functions

Function: peek-char! (peek-type stream)
Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: read-char! (stream)
Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: read-folding-mstring (stream)
Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: read-line-until-delim (stream out)

Read mstring contets from STREAM until a Newline or string delimiter ".
Read from STREAM until it consumes a Newline or reaches the string delimiter ", and write to OUT. Escaped quotes and whitespaces are treated as a non-whitespace character.

Returns two values:
- Whether there should be a linebreak at the block mode’s discretion;
- Whether it has written any contents to OUT.

Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: read-literal-mstring (stream)
Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: skip-empty-lines (stream out)

Skip all lines that contain only unescaped whitespaces, and write them out as a singular Newline. Return whether any newlines were written.

Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: skip-spaces (stream)

Skip until the first Newline or non-whitespace character and return it, unconsumed.

Package

xyz.shunter.mstrings.

Source

mstrings.lisp.

Function: whitespacep (c)
Package

xyz.shunter.mstrings.

Source

mstrings.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables