The with-setf Reference Manual

Table of Contents

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

The with-setf Reference Manual

This is the with-setf Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:44:55 2018 GMT+0.


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

1 Introduction

with-setf

This project provides 2 macros for setf'ing values for the duration of a scope.

with-setf

This macro sets a place to a given value at the start of the scope and then restores it to it's original value at the end of the scope.

with-setf contains and implicit unwind-protect so the original value will be restored even if the stack unwinds.

(with-setf (aref x 0) 10
  blah
  blah)

with-setf*

This works like with-setf but it allows you to setf multiple places for the duration of the scope.

(with-setf* ((aref a 0) 10
             (foo :plinge) :narf)
  (print "blarr"))

And as with with-setf there is a unwind-protect in case of conditions.

Why?

Some apis are just based around mutating state, gl is a good example. In these cases I still like (and want) to be able to do things by scope.

Something like this

(with-setf (depth-test context) nil
  ..draw-some-stuff..)

ends up being more reliable than me having to remember to reset the depth-test state after this chuck of rendering


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

Author

Chris Bagley (Baggers) <techsnuffle@gmail.com>

License

Unlicense

Description

Macros for setting a place for the duration of a scope

Source

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

Location

with-setf.asd

Systems

with-setf (system)


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

3.1.2 with-setf/package.lisp

Parent

with-setf (system)

Location

package.lisp

Packages

with-setf


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

3.1.3 with-setf/with-setf.lisp

Dependency

package.lisp (file)

Parent

with-setf (system)

Location

with-setf.lisp

Exported Definitions
Internal Definitions

with-setf-internals (function)


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

4 Packages

Packages are listed by definition order.


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

4.1 with-setf

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

with-setf-internals (function)


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: with-setf PLACE VALUE &body BODY

Used like this: (with-setf (aref x 0) 10 blah
blah)

Package

with-setf

Source

with-setf.lisp (file)

Macro: with-setf* PLACE-VALUE-PAIRS &body BODY

Used like this:
(with-setf* ((aref a 0) 10 (foo :plinge) :narf) (print "blarr"))

Package

with-setf

Source

with-setf.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: with-setf-internals ENV PLACES VALUES
Package

with-setf

Source

with-setf.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   W  
Index Entry  Section

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

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

W
with-setf.asd: The with-setf<dot>asd file
with-setf/package.lisp: The with-setf/package<dot>lisp file
with-setf/with-setf.lisp: The with-setf/with-setf<dot>lisp file

Jump to:   F   L   W  

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

A.2 Functions

Jump to:   F   M   W  
Index Entry  Section

F
Function, with-setf-internals: Internal functions

M
Macro, with-setf: Exported macros
Macro, with-setf*: Exported macros

W
with-setf: Exported macros
with-setf*: Exported macros
with-setf-internals: Internal functions

Jump to:   F   M   W  

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

A.3 Variables


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

A.4 Data types

Jump to:   P   S   W  
Index Entry  Section

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

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

W
with-setf: The with-setf system
with-setf: The with-setf package

Jump to:   P   S   W