The cl-locatives Reference Manual

Table of Contents

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

The cl-locatives Reference Manual

This is the cl-locatives Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:09:36 2018 GMT+0.


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

1 Introduction

                             CL-LOCATIVES
                             ============

                           By Robert Smith

Locatives are the Lisp equivalent of pointers, minus the
arithmetic. In Lisp terms, they make the concept of "places"
first-class.

The main API consists of the macro LOCATIVE-FOR, which takes as an
argument a place, as you would give to SETF; and the function
DEREFERENCE, which extracts the value of that place, and (SETF
DEREFERENCE), which sets the value of that place.

The following example pretty much sums up the API:

(let* ((x (make-array 5 :initial-element 0))
       (l (locative-for (aref x 2))))
  (setf (dereference l) 5)
  (list l
        x
        (dereference l)))

gives

(# #(0 0 5 0 0) 5)

as a result. We also have LOCATIVEP, and you can funcall the
LOCATIVE-WRITER of a locative if you need to deal with multiple values
(a rare case).

This code can be very useful for porting over C code which uses
pointers and by-reference values a lot.


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

Author

Robert Smith <quad@symbo1ics.com>

License

BSD 3-clause (See LICENSE)

Description

Implementation of locatives, pointer-like objects in Lisp.

Source

cl-locatives.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-locatives.asd

Location

cl-locatives.asd

Systems

cl-locatives (system)


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

3.1.2 cl-locatives/package.lisp

Parent

cl-locatives (system)

Location

package.lisp

Packages

cl-locatives


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

3.1.3 cl-locatives/cl-locatives.lisp

Dependency

package.lisp (file)

Parent

cl-locatives (system)

Location

cl-locatives.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 cl-locatives

A package for creating and manipulating locatives.

Source

package.lisp (file)

Nickname

loc

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


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

5.1.1 Macros

Macro: locative-for PLACE

Return a locative for the place PLACE.

PLACE should be a form that can be passed as the first argument to SETF.

Package

cl-locatives

Source

cl-locatives.lisp (file)


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

5.1.2 Functions

Function: dereference LOCATIVE

Return a value that a locative LOCATIVE "points" to.

Package

cl-locatives

Source

cl-locatives.lisp (file)

Setf Expander

(setf dereference) (setf expander)

Setf Expander: (setf dereference) LOCATIVE
Package

cl-locatives

Source

cl-locatives.lisp (file)

Reader

dereference (function)

Function: locative-writer INSTANCE
Package

cl-locatives

Source

cl-locatives.lisp (file)

Function: locativep OBJECT
Package

cl-locatives

Source

cl-locatives.lisp (file)


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

5.1.3 Structures

Structure: locative ()

A pointer-like data structure to allow, among other things, "reference passing" programming style.

Package

cl-locatives

Source

cl-locatives.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

print-object (method)

Direct slots
Slot: reader
Type

function

Initform

(error "must provide reader function.")

Readers

locative-reader (function)

Writers

(setf locative-reader) (function)

Slot: writer
Type

function

Initform

(error "must provide writer function.")

Readers

locative-writer (function)

Writers

(setf locative-writer) (function)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: %make-locative &key (READER READER) (WRITER WRITER)
Package

cl-locatives

Source

cl-locatives.lisp (file)

Function: locative-reader INSTANCE
Package

cl-locatives

Source

cl-locatives.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-locatives.asd: The cl-locatives<dot>asd file
cl-locatives/cl-locatives.lisp: The cl-locatives/cl-locatives<dot>lisp file
cl-locatives/package.lisp: The cl-locatives/package<dot>lisp file

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

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

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   %   (  
D   F   L   M   S  
Index Entry  Section

%
%make-locative: Internal functions

(
(setf dereference): Exported functions

D
dereference: Exported functions

F
Function, %make-locative: Internal functions
Function, dereference: Exported functions
Function, locative-reader: Internal functions
Function, locative-writer: Exported functions
Function, locativep: Exported functions

L
locative-for: Exported macros
locative-reader: Internal functions
locative-writer: Exported functions
locativep: Exported functions

M
Macro, locative-for: Exported macros

S
Setf Expander, (setf dereference): Exported functions

Jump to:   %   (  
D   F   L   M   S  

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

A.3 Variables

Jump to:   R   S   W  
Index Entry  Section

R
reader: Exported structures

S
Slot, reader: Exported structures
Slot, writer: Exported structures

W
writer: Exported structures

Jump to:   R   S   W  

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

A.4 Data types

Jump to:   C   L   P   S  
Index Entry  Section

C
cl-locatives: The cl-locatives system
cl-locatives: The cl-locatives package

L
locative: Exported structures

P
Package, cl-locatives: The cl-locatives package

S
Structure, locative: Exported structures
System, cl-locatives: The cl-locatives system

Jump to:   C   L   P   S