The immutable-struct Reference Manual

Table of Contents

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

The immutable-struct Reference Manual

This is the immutable-struct Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:51:00 2018 GMT+0.


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

1 Introduction


* IMMUTABLE-STRUCT 

Simple library that encourage the use of functional programming +
pattern matching.

+ =defstruct= --- provides truely nondestructive structure + integrates
  well to the pattern matchers (either optima or trivia).
+ =ftype= --- shorthand expression of =declaim ftype=

** macro defstruct (name-and-options &rest slots)

A variation of defstruct, with read-only slots and automatically defined constructor.

+ Read-only, Noninterned Slot Name :: Standard =:read-only= feature in cl
     does not prohibit the use of slot-value.
+ Constructor Function with the Same Syntax as that of Pattern Matcher :: (
     &optional ). No keyword argument.

** macro ftype (name-or-names &rest types)

Abbreviation of =(declaim (ftype (function () ) ))=.
In a smart implementation like sbcl, using =ftype= declaration is preferred
over =the= and =(declare (type ...))=.

Besides, =defun= and =ftype= both have 5 characters and gives cleaner code.

: (ftype my+ fixnum fixnum fixnum)
: (defun my+ (a b) (+ a b))

** Dependencies

This library is at least tested on implementation listed below:

+ SBCL 1.2.8 on X86-64 Linux  3.13.0-45-generic (author's environment)

Also, it depends on the following libraries:

+ Trivia by me ::

+ alexandria  ::
    Alexandria is a collection of portable public domain utilities.

* Copyright

Copyright (c) 2015 Masataro Asai (guicho2.71828@gmail.com)

* License

Licensed under the LLGPL License.



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 immutable-struct

Author

Masataro Asai

Contact

guicho2.71828@gmail.com

License

LLGPL

Description

Library that encourage the use of functional programming + pattern matching

Version

0.1

Dependencies
Source

immutable-struct.asd (file)

Component

src (module)


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

3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 immutable-struct/src

Parent

immutable-struct (system)

Location

src/

Component

package.lisp (file)


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

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


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

4.1 Lisp


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

4.1.1 immutable-struct.asd

Location

immutable-struct.asd

Systems

immutable-struct (system)

Packages

immutable-struct-asd


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

4.1.2 immutable-struct/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

immutable-struct

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 immutable-struct-asd

Source

immutable-struct.asd

Use List

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

5.2 immutable-struct

Source

package.lisp (file)

Nickname

ois

Use List
Exported Definitions
Internal Definitions

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

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


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

6.1 Exported definitions


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

6.1.1 Macros

Macro: defstruct NAME-AND-OPTIONS &optional DOCUMENTATION &rest SLOTS

A variation of defstruct, with read-only slots and automatically defined constructor.
+ The constructor name has the different convention compared to the default naming convention in cl. It has (<name> &optional <slots...>) and has no keyword argument.
+ It adds read-only option in cl:defstruct to each slot definition.
+ It uses the noninterned symbols for the name of each slot, disallowing the use of slot-value. + It also defines a pattern matcher clause in exactly the same form as the constructor.

Package

immutable-struct

Source

package.lisp (file)

Macro: ftype NAME-OR-NAMES &rest TYPES

abbreviation of (declaim (ftype (function (<types...>) <type>) <name>)). the last type is used for the return type.

Package

immutable-struct

Source

package.lisp (file)


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

6.2 Internal definitions


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

6.2.1 Functions

Function: append-constructor NAME-AND-OPTIONS SLOTS
Package

immutable-struct

Source

package.lisp (file)

Function: canonical-defstruct NAME-AND-OPTIONS DOCUMENTATION SLOTS
Package

immutable-struct

Source

package.lisp (file)

Function: canonicalize-name-or-names NAME-OR-NAMES
Package

immutable-struct

Source

package.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   I   L   M  
Index Entry  Section

F
File, Lisp, immutable-struct.asd: The immutable-struct<dot>asd file
File, Lisp, immutable-struct/src/package.lisp: The immutable-struct/src/package<dot>lisp file

I
immutable-struct.asd: The immutable-struct<dot>asd file
immutable-struct/src: The immutable-struct/src module
immutable-struct/src/package.lisp: The immutable-struct/src/package<dot>lisp file

L
Lisp File, immutable-struct.asd: The immutable-struct<dot>asd file
Lisp File, immutable-struct/src/package.lisp: The immutable-struct/src/package<dot>lisp file

M
Module, immutable-struct/src: The immutable-struct/src module

Jump to:   F   I   L   M  

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

A.2 Functions

Jump to:   A   C   D   F   M  
Index Entry  Section

A
append-constructor: Internal functions

C
canonical-defstruct: Internal functions
canonicalize-name-or-names: Internal functions

D
defstruct: Exported macros

F
ftype: Exported macros
Function, append-constructor: Internal functions
Function, canonical-defstruct: Internal functions
Function, canonicalize-name-or-names: Internal functions

M
Macro, defstruct: Exported macros
Macro, ftype: Exported macros

Jump to:   A   C   D   F   M  

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

A.3 Variables


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

A.4 Data types

Jump to:   I   P   S  
Index Entry  Section

I
immutable-struct: The immutable-struct system
immutable-struct: The immutable-struct package
immutable-struct-asd: The immutable-struct-asd package

P
Package, immutable-struct: The immutable-struct package
Package, immutable-struct-asd: The immutable-struct-asd package

S
System, immutable-struct: The immutable-struct system

Jump to:   I   P   S