Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the trivial-with Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 18:08:24 2021 GMT+0.
• Introduction | What trivial-with is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
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 ...
...)
...
)
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: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The trivial-with system |
StackSmith <fpgasm@apple2.x10.mx>
BSD 3-clause license
Replace nested with-xxx invocations with a single with:all form
trivial-with.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The trivial-with.asd file | ||
• The trivial-with/package.lisp file | ||
• The trivial-with/trivial-with.lisp file |
Next: The trivial-with/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
trivial-with.asd
trivial-with (system)
Next: The trivial-with/trivial-with․lisp file, Previous: The trivial-with․asd file, Up: Lisp files [Contents][Index]
trivial-with (system)
package.lisp
Previous: The trivial-with/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
trivial-with (system)
trivial-with.lisp
all (macro)
side-effect (macro)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The trivial-with package |
package.lisp (file)
with
common-lisp
all (macro)
side-effect (macro)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Create nested with-... forms for all things
trivial-with.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
trivial-with.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L T |
---|
Jump to: | F L T |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
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: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
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 |
---|