The trivial-with Reference Manual

Table of Contents

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

The trivial-with Reference Manual

This is the trivial-with Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:28:04 2018 GMT+0.


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

1 Introduction

TRIVIAL-WITH

TRIVIAL-WITH is a simple library designed to contain multiple levels of WITH- invocations into a single WITH:- form.

There are many Lisp idioms prefixed with WITH-. By containing an environment (and often hiding the cleanup code) they make Lisp a great language. However, having a lot of nested WITH- forms is a visual nuisance.

with:all is implemented as a macro that expands into nested WITH-xxx forms. Because it expands syntactically, you may use it with any Lisp macro that starts with the characters "WITH-".

(with:all
  ((open-file (in "my-file"))
   (slots (x y) rect)
   (foreign-slots ...
   ...)
 ...
)

NOTES

WITH- forms that return a value

Most with- style macros create an environment in the contained body of code. There are exceptions such as with-output-to-string, which by default returns a string. Placed inside a with:all macro the string would be lost (unless it (with-output-to-string..) form was the first one in the list.

TRIVIAL-WITH can capture the return value of a (WITH-xxx) by setting the value of a symbol that precedes the form by using `(with:side-effect var ...)

(with:all
  ((open-file (in "my-file"))
   (slots (x y) rect)
   (side-effect z (output-to-string (x))
   ...
  )
  ...
  )

The above will basically expand to (setf z (with-output-to-string...)) The variable z of course must be in scope for this to work.


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-with

Author

StackSmith <fpgasm@apple2.x10.mx>

License

BSD 3-clause license

Description

Replace nested with-xxx invocations with a single with:all form

Source

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

Location

trivial-with.asd

Systems

trivial-with (system)


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

3.1.2 trivial-with/package.lisp

Parent

trivial-with (system)

Location

package.lisp

Packages

trivial-with


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

3.1.3 trivial-with/trivial-with.lisp

Dependency

package.lisp (file)

Parent

trivial-with (system)

Location

trivial-with.lisp

Exported Definitions

all (macro)

Internal Definitions

side-effect (macro)


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

4 Packages

Packages are listed by definition order.


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

4.1 trivial-with

Source

package.lisp (file)

Nickname

with

Use List

common-lisp

Exported Definitions

all (macro)

Internal Definitions

side-effect (macro)


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: all (&rest THINGS) &body BODY

Create nested with-... forms for all things

Package

trivial-with

Source

trivial-with.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Macros

Macro: side-effect VAR &body BODY
Package

trivial-with

Source

trivial-with.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-with.asd: The trivial-with<dot>asd file
File, Lisp, trivial-with/package.lisp: The trivial-with/package<dot>lisp file
File, Lisp, trivial-with/trivial-with.lisp: The trivial-with/trivial-with<dot>lisp file

L
Lisp File, trivial-with.asd: The trivial-with<dot>asd file
Lisp File, trivial-with/package.lisp: The trivial-with/package<dot>lisp file
Lisp File, trivial-with/trivial-with.lisp: The trivial-with/trivial-with<dot>lisp file

T
trivial-with.asd: The trivial-with<dot>asd file
trivial-with/package.lisp: The trivial-with/package<dot>lisp file
trivial-with/trivial-with.lisp: The trivial-with/trivial-with<dot>lisp file

Jump to:   F   L   T  

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

A.2 Functions

Jump to:   A   M   S  
Index Entry  Section

A
all: Exported macros

M
Macro, all: Exported macros
Macro, side-effect: Internal macros

S
side-effect: Internal macros

Jump to:   A   M   S  

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

A.3 Variables


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

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

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

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

T
trivial-with: The trivial-with system
trivial-with: The trivial-with package

Jump to:   P   S   T