The cl-emb Reference Manual

This is the cl-emb Reference Manual, version 0.4.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:10:03 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-emb

A templating system for Common Lisp

Author

Stefan Scholl <>

License

Lesser Lisp General Public License

Version

0.4.3

Dependency

cl-ppcre (system).

Source

cl-emb.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-emb/cl-emb.asd

Source

cl-emb.asd.

Parent Component

cl-emb (system).

ASDF Systems

cl-emb.

Packages

cl-emb.system.


3.1.2 cl-emb/packages.lisp

Source

cl-emb.asd.

Parent Component

cl-emb (system).

Packages

cl-emb.


3.1.3 cl-emb/emb.lisp

Dependency

packages.lisp (file).

Source

cl-emb.asd.

Parent Component

cl-emb (system).

Packages

cl-emb-intern.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-emb-intern

Source

emb.lisp.

Use List

common-lisp.


4.2 cl-emb

Source

packages.lisp.

Nickname

emb

Use List

common-lisp.

Public Interface
Internals

4.3 cl-emb.system

Source

cl-emb.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *case-sensitivity*

Whether use case-sensitive mode (the default) or case-insensitive mode. If this is set NIL, the case of keys in ENV will be ignored.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *debug*

Debugging for CL-EMB.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *emb-end-marker*

End of scriptlet or expression.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *emb-start-marker*

Start of scriptlet or expression. Remember that a following #= indicates an expression.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *escape-type*

Default value for escaping @var output.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *function-package*

Package the emb function body gets interned to.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *locking-function*

Function to call to lock access to an internal hash table. Must accept a function designator which must be called with the lock hold.

Package

cl-emb.

Source

emb.lisp.


5.1.2 Ordinary functions

Function: clear-emb (name)

Remove named emb code.

Package

cl-emb.

Source

emb.lisp.

Function: clear-emb-all ()

Remove all registered emb code.

Package

cl-emb.

Source

emb.lisp.

Function: clear-emb-all-files ()

Remove all registered file emb code (registered/executed by a pathname).

Package

cl-emb.

Source

emb.lisp.

Function: clear-expand-template-tag-hash ()

Removes all scanners for template tags from cache.

Package

cl-emb.

Source

emb.lisp.

Function: construct-emb-function (code)

Builds and compiles the emb-function out of template code.

Package

cl-emb.

Source

emb.lisp.

Function: pprint-emb-function (name)

DEBUG function. Pretty prints function form, if *DEBUG* was t when the function was registered.

Package

cl-emb.

Source

emb.lisp.


5.1.3 Generic functions

Generic Function: execute-emb (name &key env generator-maker)

Execute named emb code. Returns a string. Keyword parameter ENV to pass objects to the code. ENV must be a plist.

Package

cl-emb.

Source

emb.lisp.

Methods
Method: execute-emb ((name pathname) &key env generator-maker)
Method: execute-emb (name &key env generator-maker)
Generic Function: getf* (thing key &optional default)

Returns a value by a key

Package

cl-emb.

Source

emb.lisp.

Methods
Method: getf* ((object standard-object) key &optional default)

Uses slot-value to get a value from a standard object, where the slot name is derived from key

Method: getf* ((table hash-table) key &optional default)

Uses gethash to get a value from a hash-table

Method: getf* ((plist list) key &optional default)

Uses getf to get a value from a plist

Generic Function: register-emb (name code)

Register given CODE as NAME.

Package

cl-emb.

Source

emb.lisp.

Methods
Method: register-emb (name (code string))
Method: register-emb (name (code pathname))

5.2 Internals


5.2.1 Special variables

Special Variable: *emb-stream-redirection*
Package

cl-emb.

Source

emb.lisp.

Special Variable: *functions*

Table mapping names to emb-function instances.

Package

cl-emb.

Source

emb.lisp.

Special Variable: *latex-replacements*
Package

cl-emb.

Source

emb.lisp.

Special Variable: *set-parameter-list*
Package

cl-emb.

Source

emb.lisp.

Special Variable: *set-special-list*
Package

cl-emb.

Source

emb.lisp.

Special Variable: *template-tag-expand*

List of conses. FIRST is regex, REST replacement (STRING or FUNCTION). Functions get called with two parameters: match and list of registers.

Package

cl-emb.

Source

emb.lisp.


5.2.2 Macros

Macro: getf-emb (key)

Search either plist TOPENV or ENV according to the search path in KEY. KEY is a string.

Package

cl-emb.

Source

emb.lisp.

Macro: with-lock (&body body)

Locking all accesses to *functions*

Package

cl-emb.

Source

emb.lisp.


5.2.3 Ordinary functions

Function: autofuncall (v)
Package

cl-emb.

Source

emb.lisp.

Function: construct-emb-body-string (code &optional start)

Takes a string containing an emb code and returns a string containing the lisp code that implements that emb code.

Package

cl-emb.

Source

emb.lisp.

Function: contents-of-file (pathname)

Returns a string with the entire contents of the specified file.

Package

cl-emb.

Source

emb.lisp.

Function: echo (string &key escape)

Emit given STRING. Escape if wanted (global or via ESCAPE keyword). STRING can be NIL.

Package

cl-emb.

Source

emb.lisp.

Function: escape-by-table (string replacements)
Package

cl-emb.

Source

emb.lisp.

Function: escape-for-latex (string)
Package

cl-emb.

Source

emb.lisp.

Function: escape-for-xml (string)
Package

cl-emb.

Source

emb.lisp.

Function: expand-template-tags (string)

Expand template-tags (@if, @else, ...) to Common Lisp. Replacement and regex in *TEMPLATE-TAG-EXPAND*

Package

cl-emb.

Source

emb.lisp.

Function: get-emb-function (name)

Returns the named function implementing a registered emb code. Rebuilds it when text template was a file which has been modified.

Package

cl-emb.

Source

emb.lisp.

Function: insert-file (filename)

Get given file FILENAME.

Package

cl-emb.

Source

emb.lisp.

Function: make-emb-function (path time function &optional form)

Constructor for class EMB-FUNCTION.

Package

cl-emb.

Source

emb.lisp.

Function: next-code (string start)
Package

cl-emb.

Source

emb.lisp.

Function: scanner-for-expand-template-tag (tag)

Returns a CL-PPCRE scanner which matches a template tag expanded by EXPAND-TEMPLATE-TAGS. Scanners are memoized in SCANNER-HASH once they are created.

Package

cl-emb.

Source

emb.lisp.

Function: set-specials (match &rest registers)

Parse parameter(s) of @set and set special variables like e. g. *ESCAPE-TYPE*.

Package

cl-emb.

Source

emb.lisp.

Function: string-right-trim-spaces-until-newline (string)
Package

cl-emb.

Source

emb.lisp.

Function: string-to-keyword (string)

Interns a given STRING uppercased in the keyword package.

Package

cl-emb.

Source

emb.lisp.

Function: tag-template (tag-type)
Package

cl-emb.

Source

emb.lisp.

Function: url-encode (string)

URL-encode a string.

Package

cl-emb.

Source

emb.lisp.


5.2.4 Generic functions

Generic Reader: emb-function-form (object)
Package

cl-emb.

Methods
Reader Method: emb-function-form ((emb-function emb-function))

automatically generated reader method

Source

emb.lisp.

Target Slot

form.

Generic Writer: (setf emb-function-form) (object)
Package

cl-emb.

Methods
Writer Method: (setf emb-function-form) ((emb-function emb-function))

automatically generated writer method

Source

emb.lisp.

Target Slot

form.

Generic Reader: emb-function-function (object)
Package

cl-emb.

Methods
Reader Method: emb-function-function ((emb-function emb-function))

automatically generated reader method

Source

emb.lisp.

Target Slot

function.

Generic Writer: (setf emb-function-function) (object)
Package

cl-emb.

Methods
Writer Method: (setf emb-function-function) ((emb-function emb-function))

automatically generated writer method

Source

emb.lisp.

Target Slot

function.

Generic Reader: emb-function-path (object)
Package

cl-emb.

Methods
Reader Method: emb-function-path ((emb-function emb-function))

automatically generated reader method

Source

emb.lisp.

Target Slot

path.

Generic Writer: (setf emb-function-path) (object)
Package

cl-emb.

Methods
Writer Method: (setf emb-function-path) ((emb-function emb-function))

automatically generated writer method

Source

emb.lisp.

Target Slot

path.

Generic Reader: emb-function-time (object)
Package

cl-emb.

Methods
Reader Method: emb-function-time ((emb-function emb-function))

automatically generated reader method

Source

emb.lisp.

Target Slot

time.

Generic Writer: (setf emb-function-time) (object)
Package

cl-emb.

Methods
Writer Method: (setf emb-function-time) ((emb-function emb-function))

automatically generated writer method

Source

emb.lisp.

Target Slot

time.


5.2.5 Classes

Class: emb-function
Package

cl-emb.

Source

emb.lisp.

Direct methods
Direct slots
Slot: path
Initargs

:path

Readers

emb-function-path.

Writers

(setf emb-function-path).

Slot: time
Package

common-lisp.

Initargs

:time

Readers

emb-function-time.

Writers

(setf emb-function-time).

Slot: function
Package

common-lisp.

Initargs

:function

Readers

emb-function-function.

Writers

(setf emb-function-function).

Slot: form
Initargs

:form

Readers

emb-function-form.

Writers

(setf emb-function-form).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   E   F   G   I   M   N   P   R   S   T   U   W  
Index Entry  Section

(
(setf emb-function-form): Private generic functions
(setf emb-function-form): Private generic functions
(setf emb-function-function): Private generic functions
(setf emb-function-function): Private generic functions
(setf emb-function-path): Private generic functions
(setf emb-function-path): Private generic functions
(setf emb-function-time): Private generic functions
(setf emb-function-time): Private generic functions

A
autofuncall: Private ordinary functions

C
clear-emb: Public ordinary functions
clear-emb-all: Public ordinary functions
clear-emb-all-files: Public ordinary functions
clear-expand-template-tag-hash: Public ordinary functions
construct-emb-body-string: Private ordinary functions
construct-emb-function: Public ordinary functions
contents-of-file: Private ordinary functions

E
echo: Private ordinary functions
emb-function-form: Private generic functions
emb-function-form: Private generic functions
emb-function-function: Private generic functions
emb-function-function: Private generic functions
emb-function-path: Private generic functions
emb-function-path: Private generic functions
emb-function-time: Private generic functions
emb-function-time: Private generic functions
escape-by-table: Private ordinary functions
escape-for-latex: Private ordinary functions
escape-for-xml: Private ordinary functions
execute-emb: Public generic functions
execute-emb: Public generic functions
execute-emb: Public generic functions
expand-template-tags: Private ordinary functions

F
Function, autofuncall: Private ordinary functions
Function, clear-emb: Public ordinary functions
Function, clear-emb-all: Public ordinary functions
Function, clear-emb-all-files: Public ordinary functions
Function, clear-expand-template-tag-hash: Public ordinary functions
Function, construct-emb-body-string: Private ordinary functions
Function, construct-emb-function: Public ordinary functions
Function, contents-of-file: Private ordinary functions
Function, echo: Private ordinary functions
Function, escape-by-table: Private ordinary functions
Function, escape-for-latex: Private ordinary functions
Function, escape-for-xml: Private ordinary functions
Function, expand-template-tags: Private ordinary functions
Function, get-emb-function: Private ordinary functions
Function, insert-file: Private ordinary functions
Function, make-emb-function: Private ordinary functions
Function, next-code: Private ordinary functions
Function, pprint-emb-function: Public ordinary functions
Function, scanner-for-expand-template-tag: Private ordinary functions
Function, set-specials: Private ordinary functions
Function, string-right-trim-spaces-until-newline: Private ordinary functions
Function, string-to-keyword: Private ordinary functions
Function, tag-template: Private ordinary functions
Function, url-encode: Private ordinary functions

G
Generic Function, (setf emb-function-form): Private generic functions
Generic Function, (setf emb-function-function): Private generic functions
Generic Function, (setf emb-function-path): Private generic functions
Generic Function, (setf emb-function-time): Private generic functions
Generic Function, emb-function-form: Private generic functions
Generic Function, emb-function-function: Private generic functions
Generic Function, emb-function-path: Private generic functions
Generic Function, emb-function-time: Private generic functions
Generic Function, execute-emb: Public generic functions
Generic Function, getf*: Public generic functions
Generic Function, register-emb: Public generic functions
get-emb-function: Private ordinary functions
getf*: Public generic functions
getf*: Public generic functions
getf*: Public generic functions
getf*: Public generic functions
getf-emb: Private macros

I
insert-file: Private ordinary functions

M
Macro, getf-emb: Private macros
Macro, with-lock: Private macros
make-emb-function: Private ordinary functions
Method, (setf emb-function-form): Private generic functions
Method, (setf emb-function-function): Private generic functions
Method, (setf emb-function-path): Private generic functions
Method, (setf emb-function-time): Private generic functions
Method, emb-function-form: Private generic functions
Method, emb-function-function: Private generic functions
Method, emb-function-path: Private generic functions
Method, emb-function-time: Private generic functions
Method, execute-emb: Public generic functions
Method, execute-emb: Public generic functions
Method, getf*: Public generic functions
Method, getf*: Public generic functions
Method, getf*: Public generic functions
Method, register-emb: Public generic functions
Method, register-emb: Public generic functions

N
next-code: Private ordinary functions

P
pprint-emb-function: Public ordinary functions

R
register-emb: Public generic functions
register-emb: Public generic functions
register-emb: Public generic functions

S
scanner-for-expand-template-tag: Private ordinary functions
set-specials: Private ordinary functions
string-right-trim-spaces-until-newline: Private ordinary functions
string-to-keyword: Private ordinary functions

T
tag-template: Private ordinary functions

U
url-encode: Private ordinary functions

W
with-lock: Private macros


A.3 Variables

Jump to:   *  
F   P   S   T  
Index Entry  Section

*
*case-sensitivity*: Public special variables
*debug*: Public special variables
*emb-end-marker*: Public special variables
*emb-start-marker*: Public special variables
*emb-stream-redirection*: Private special variables
*escape-type*: Public special variables
*function-package*: Public special variables
*functions*: Private special variables
*latex-replacements*: Private special variables
*locking-function*: Public special variables
*set-parameter-list*: Private special variables
*set-special-list*: Private special variables
*template-tag-expand*: Private special variables

F
form: Private classes
function: Private classes

P
path: Private classes

S
Slot, form: Private classes
Slot, function: Private classes
Slot, path: Private classes
Slot, time: Private classes
Special Variable, *case-sensitivity*: Public special variables
Special Variable, *debug*: Public special variables
Special Variable, *emb-end-marker*: Public special variables
Special Variable, *emb-start-marker*: Public special variables
Special Variable, *emb-stream-redirection*: Private special variables
Special Variable, *escape-type*: Public special variables
Special Variable, *function-package*: Public special variables
Special Variable, *functions*: Private special variables
Special Variable, *latex-replacements*: Private special variables
Special Variable, *locking-function*: Public special variables
Special Variable, *set-parameter-list*: Private special variables
Special Variable, *set-special-list*: Private special variables
Special Variable, *template-tag-expand*: Private special variables

T
time: Private classes