The cl-splicing-macro Reference Manual

Table of Contents

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

The cl-splicing-macro Reference Manual

This is the cl-splicing-macro Reference Manual, version 0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:24:15 2018 GMT+0.


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

1 Introduction

cl-splicing-macro

Features of this package are defmacro-enhance useable! (I.e. in DEFMACRO! from DEFMACRO-ENHANCE system both sampling expansion and splicing expansion can be used)

This package adds a possibility for macros to inject several forms (not just one) into surrounding macros's body.

CL-SPLICING-MACRO> (defmacro bar (&rest things)
                     "Just a toy macros, that expands into a PLUS"
                     `(+ ,@things))
CL-SPLICING-MACRO> (define-maybe-splicing-macro foo (a b &sample (1 2))
                     "Just a toy macro that will splice in the body of surrounding macro."
                     `(sprogn ,a ,b))
CL-SPLICING-MACRO> (macroexpand-1 '(bar 1 2 (foo 3 4) 5 6))
(+ 1 2 3 4 5 6) ; enjoy!

Sampling macroexpansion

Whether a given macros is splicing or not is decided on basis of whether its expansion contains SPROGN in CAR-position, or not. For this to work, we need a "characteristic expansion" of this macros, or a "testing expansion".

New magic word &SAMPLE in macro-lambda-list is used to provide parameters of a macro, that result in generic-enough expansion (against which checks on the structure of the expansion can be made).

Sampling expansion for a given macros, if present, can be obtained with help of TESTING-EXPANSION macros.

CL-SPLICING-MACRO> (define-maybe-sampling-macro my-macro (a &sample (qwerty))
                     ...) ; define-my-clever-macro
CL-SPLICING-MACRO> (if (indeed-clever-expansion-p (testing-expansion my-macro))
                       do-something-useful)

By default, DEFINE-MAYBE-SAMPLING-MACRO is a wrapper around plain DEFMACRO, but DEFINE-/SAMPLING! macro-construction macros can be used to add sampling feature to your favorite DEFMACRO-like operator (e.g. DEFMACRO! from Let-Over-Lambda).

CL-SPLICING-MACRO> (define-/sampling! def-my-fav-macro-sampling def-my-fav-macro)

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-splicing-macro

Author

Alexandr Popolitov <popolit@gmail.com>

License

GPL

Description

Deforms macros in a way, that they can capture surrounding s-exps for their expansion.

Version

0.1

Source

cl-splicing-macro.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-splicing-macro.asd

Location

cl-splicing-macro.asd

Systems

cl-splicing-macro (system)


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

3.1.2 cl-splicing-macro/package.lisp

Parent

cl-splicing-macro (system)

Location

package.lisp

Packages

cl-splicing-macro


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

3.1.3 cl-splicing-macro/sbcl.lisp

Dependency

package.lisp (file)

Parent

cl-splicing-macro (system)

Location

sbcl.lisp


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

3.1.4 cl-splicing-macro/cl-splicing-macro.lisp

Dependency

sbcl.lisp (file)

Parent

cl-splicing-macro (system)

Location

cl-splicing-macro.lisp

Exported Definitions
Internal Definitions

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

3.1.5 cl-splicing-macro/sbcl-2.lisp

Dependency

cl-splicing-macro.lisp (file)

Parent

cl-splicing-macro (system)

Location

sbcl-2.lisp


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

4 Packages

Packages are listed by definition order.


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

4.1 cl-splicing-macro

Source

package.lisp (file)

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


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

5.1.1 Macros

Macro: define-/sampling! SRC-NAME DST-NAME

Define macro SRC-NAME on top of DST-NAME.
Adds possibility to specify sample macroexpansion data, via &SAMPLE magic word in ARGS. Expects ARGS list to contain ARGS variable, which contains lambda-list.

Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: define-/splicing! SRC-NAME DST-NAME
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: define-maybe-sampling-macro NAME ARGS &body BODY
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: define-maybe-splicing-macro NAME LAMBDA-LIST &body BODY
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: disable-splicing-macro ()
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: enable-splicing-macro ()
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: sprogn &rest FORMS
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: testing-expansion NAME
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Macro: with-splicing-macro-runtime &body BODY
Package

cl-splicing-macro

Source

cl-splicing-macro.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: *sample-expansion-data*
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Special Variable: *splicing-macro*
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)


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

5.2.2 Functions

Function: %disable-splicing-macro ()
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Function: %enable-splicing-macro ()
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Function: ampersand-symbol-p SYM
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Function: mk-splicing-macroexpand-hook OLD-MACROEXPAND-HOOK
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)

Function: parse-sample-from-lambda-list LST
Package

cl-splicing-macro

Source

cl-splicing-macro.lisp (file)


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-splicing-macro.asd: The cl-splicing-macro<dot>asd file
cl-splicing-macro/cl-splicing-macro.lisp: The cl-splicing-macro/cl-splicing-macro<dot>lisp file
cl-splicing-macro/package.lisp: The cl-splicing-macro/package<dot>lisp file
cl-splicing-macro/sbcl-2.lisp: The cl-splicing-macro/sbcl-2<dot>lisp file
cl-splicing-macro/sbcl.lisp: The cl-splicing-macro/sbcl<dot>lisp file

F
File, Lisp, cl-splicing-macro.asd: The cl-splicing-macro<dot>asd file
File, Lisp, cl-splicing-macro/cl-splicing-macro.lisp: The cl-splicing-macro/cl-splicing-macro<dot>lisp file
File, Lisp, cl-splicing-macro/package.lisp: The cl-splicing-macro/package<dot>lisp file
File, Lisp, cl-splicing-macro/sbcl-2.lisp: The cl-splicing-macro/sbcl-2<dot>lisp file
File, Lisp, cl-splicing-macro/sbcl.lisp: The cl-splicing-macro/sbcl<dot>lisp file

L
Lisp File, cl-splicing-macro.asd: The cl-splicing-macro<dot>asd file
Lisp File, cl-splicing-macro/cl-splicing-macro.lisp: The cl-splicing-macro/cl-splicing-macro<dot>lisp file
Lisp File, cl-splicing-macro/package.lisp: The cl-splicing-macro/package<dot>lisp file
Lisp File, cl-splicing-macro/sbcl-2.lisp: The cl-splicing-macro/sbcl-2<dot>lisp file
Lisp File, cl-splicing-macro/sbcl.lisp: The cl-splicing-macro/sbcl<dot>lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   %  
A   D   E   F   M   P   S   T   W  
Index Entry  Section

%
%disable-splicing-macro: Internal functions
%enable-splicing-macro: Internal functions

A
ampersand-symbol-p: Internal functions

D
define-/sampling!: Exported macros
define-/splicing!: Exported macros
define-maybe-sampling-macro: Exported macros
define-maybe-splicing-macro: Exported macros
disable-splicing-macro: Exported macros

E
enable-splicing-macro: Exported macros

F
Function, %disable-splicing-macro: Internal functions
Function, %enable-splicing-macro: Internal functions
Function, ampersand-symbol-p: Internal functions
Function, mk-splicing-macroexpand-hook: Internal functions
Function, parse-sample-from-lambda-list: Internal functions

M
Macro, define-/sampling!: Exported macros
Macro, define-/splicing!: Exported macros
Macro, define-maybe-sampling-macro: Exported macros
Macro, define-maybe-splicing-macro: Exported macros
Macro, disable-splicing-macro: Exported macros
Macro, enable-splicing-macro: Exported macros
Macro, sprogn: Exported macros
Macro, testing-expansion: Exported macros
Macro, with-splicing-macro-runtime: Exported macros
mk-splicing-macroexpand-hook: Internal functions

P
parse-sample-from-lambda-list: Internal functions

S
sprogn: Exported macros

T
testing-expansion: Exported macros

W
with-splicing-macro-runtime: Exported macros

Jump to:   %  
A   D   E   F   M   P   S   T   W  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*sample-expansion-data*: Internal special variables
*splicing-macro*: Internal special variables

S
Special Variable, *sample-expansion-data*: Internal special variables
Special Variable, *splicing-macro*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-splicing-macro: The cl-splicing-macro system
cl-splicing-macro: The cl-splicing-macro package

P
Package, cl-splicing-macro: The cl-splicing-macro package

S
System, cl-splicing-macro: The cl-splicing-macro system

Jump to:   C   P   S