The string-case Reference Manual

This is the string-case Reference Manual, version 0.0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:58:12 2024 GMT+0.

Table of Contents


1 Systems

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


1.1 string-case

string-case is a macro that generates specialised decision trees to dispatch on string equality

Author

Paul Khuong

License

3-clause BSD

Version

0.0.2

Source

string-case.asd.

Child Component

string-case.lisp (file).


2 Files

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


2.1 Lisp


2.1.1 string-case/string-case.asd

Source

string-case.asd.

Parent Component

string-case (system).

ASDF Systems

string-case.


2.1.2 string-case/string-case.lisp

Source

string-case.asd.

Parent Component

string-case (system).

Packages

string-case.

Public Interface

string-case (macro).

Internals

3 Packages

Packages are listed by definition order.


3.1 string-case

Source

string-case.lisp.

Use List
  • common-lisp.
  • sb-c.
  • sb-vm.
Public Interface

string-case (macro).

Internals

4 Definitions

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


4.1 Public Interface


4.1.1 Macros

Macro: string-case ((string &key default) &body cases)

(string-case (string &key default) case*)
case ::= string form*
| t form*
Where t is the default case.

Package

string-case.

Source

string-case.lisp.


4.2 Internals


4.2.1 Special variables

Special Variable: *input-string*

Symbol of the variable holding the input string

Package

string-case.

Source

string-case.lisp.

Special Variable: *no-match-form*

Form to insert when no match is found.

Package

string-case.

Source

string-case.lisp.


4.2.2 Ordinary functions

Function: all-equal (list &key key test)
Package

string-case.

Source

string-case.lisp.

Function: emit-common-checks (strings to-check)
Package

string-case.

Source

string-case.lisp.

Function: emit-string-case (cases input-var no-match)
Package

string-case.

Source

string-case.lisp.

Function: find-best-split (strings to-check)

Iterate over all the indices left to check to find which index (and which character) to test for equality with, keeping the ones which result in the most balanced split.

Package

string-case.

Source

string-case.lisp.

Function: hash-table->list (table &key keep-keys keep-values)

Saves the keys and/or values in table to a list. As with hash table iterating functions, there is no implicit ordering.

Package

string-case.

Source

string-case.lisp.

Function: iota (n)
Package

string-case.

Source

string-case.lisp.

Function: make-search-tree (strings bodies to-check)
Package

string-case.

Source

string-case.lisp.

Function: numeric-char= (x y)
Package

string-case.

Source

string-case.lisp.

Function: split (list &key test key)

Splits input list into sublists of elements
whose elements are all such that (key element)
are all test.
It’s assumed that test and key form an equality class. (This is similar to groupBy)

Package

string-case.

Source

string-case.lisp.

Function: split-at (list n)

Split list in k lists of n elements (or less for the last list)

Package

string-case.

Source

string-case.lisp.


Appendix A Indexes


A.1 Concepts