The trivial-types Reference Manual

This is the trivial-types Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:58:36 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 trivial-types

Trivial type definitions

Author

Tomohiro Matsuyama

License

LLGPL

Long Description

TRIVIAL-TYPES provides missing but important type
definitions such as PROPER-LIST, ASSOCIATION-LIST, PROPERTY-LIST and TUPLE.

By using these types, you can keep type declarations more accurate. For example, you may write a class definition like:

(defclass person ()
((name :type string))
((age :type fixnum))
((friends :type list)))

However, it is not obvious for anyone except you that FRIENDS slot has only a list of person. If you want declare FRIENDS slot more accurately, PROPER-LIST is the best for that:

(defclass person ()
((name :type string))
((age :type fixnum))
((friends :type (proper-list person))))

In addition, TRIVIAL-TYPES also provides standard designators defined in ANSI standard such as PACKAGE-DESIGNATOR. They are useful when you write a function that takes a package-oid argument like:

(defun list-external-symbols (package)
(declare (package-designator package))
(loop for symbol being the external-symbol of package collect symbol))

Version

0.1

Source

trivial-types.asd.

Child Component

src (module).


3 Modules

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


3.1 trivial-types/src

Source

trivial-types.asd.

Parent Component

trivial-types (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 trivial-types/trivial-types.asd

Source

trivial-types.asd.

Parent Component

trivial-types (system).

ASDF Systems

trivial-types.

Packages

trivial-types-asd.


4.1.2 trivial-types/src/package.lisp

Source

trivial-types.asd.

Parent Component

src (module).

Packages

trivial-types.


4.1.3 trivial-types/src/specials.lisp

Dependency

package.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Internals

*standard-optimize-qualities* (special variable).


4.1.4 trivial-types/src/lists.lisp

Dependency

specials.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Public Interface
Internals

%proper-list-p (macro).


4.1.5 trivial-types/src/designators.lisp

Dependency

lists.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Public Interface

4.1.6 trivial-types/src/streams.lisp

Dependency

designators.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Public Interface

4.1.7 trivial-types/src/combinators.lisp

Dependency

streams.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Public Interface

non-nil (type).


4.1.8 trivial-types/src/typespecs.lisp

Dependency

combinators.lisp (file).

Source

trivial-types.asd.

Parent Component

src (module).

Public Interface

5 Packages

Packages are listed by definition order.


5.1 trivial-types-asd

Source

trivial-types.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.2 trivial-types

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Ordinary functions

Function: association-list-p (var)

Returns true if OBJECT is an association list.

Examples:

(association-list-p 1) => NIL (association-list-p ’(1 2 3)) => NIL (association-list-p nil) => T (association-list-p ’((foo))) => T (association-list-p ’((:a . 1) (:b . 2))) => T

Package

trivial-types.

Source

lists.lisp.

Function: file-associated-stream-p (stream)

Returns true if STREAM is a stream associated to a file.

Package

trivial-types.

Source

streams.lisp.

Function: proper-list-p (object)

Returns true if OBJECT is a proper list.

Examples:

(proper-list-p 1) => NIL (proper-list-p ’(1 . 2)) => NIL (proper-list-p nil) => T (proper-list-p ’(1 2 3)) => T

Package

trivial-types.

Source

lists.lisp.

Function: property-list-p (object)

Returns true if OBJECT is a property list.

Examples:

(property-list-p 1) => NIL (property-list-p ’(1 2 3)) => NIL (property-list-p ’(foo)) => NIL (property-list-p nil) => T (property-list-p ’(foo 1)) => T (property-list-p ’(:a 1 :b 2)) => T

Package

trivial-types.

Source

lists.lisp.

Function: tuple (&rest args)

Exactly same as LIST.

Package

trivial-types.

Source

lists.lisp.

Function: tuplep (object)

Returns true if OBJECT is a tuple, meaning a proper list.

Examples:

(tuplep 1) => NIL
(tuplep ’(1 . 2)) => NIL
(tuplep nil) => T
(tuplep ’(1 2 3)) => T

Package

trivial-types.

Source

lists.lisp.

Function: type-expand (type-specifier &optional env)

Expand TYPE-SPECIFIER in the lexical environment ENV.

Package

trivial-types.

Source

typespecs.lisp.

Function: type-specifier-p (type-specifier)

Returns true if TYPE-SPECIFIER is a valid type specfiier.

Package

trivial-types.

Source

typespecs.lisp.


6.1.2 Types

Type: association-list (&optional key-type value-type)

Equivalent to ‘(proper-list (cons KEY-TYPE VALUE-TYPE))‘. KEY-TYPE and VALUE-TYPE are just ignored.

Examples:

(typep ’((:a . 1) (:b . 2)) ’(association-list integer)) => T (typep ’((:a . 1) (:b . 2)) ’(association-list string)) => T

Package

trivial-types.

Source

lists.lisp.

Type: character-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: file-associated-stream ()

Equivalent to ‘(and stream (satisfies file-associated-stream-p))‘.

Package

trivial-types.

Source

streams.lisp.

Type: file-position-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: function-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: list-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: non-nil (&optional type)

Equivalent to ‘(and (not null) TYPE)‘ if TYPE is given, otherwise ‘(not null)‘.

Examples:

(typep nil ’(non-nil symbol)) => NIL

Package

trivial-types.

Source

combinators.lisp.

Type: package-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: pathname-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: proper-list (&optional element-type)

Equivalent to ‘(and list (satisfies proper-list-p))‘. ELEMENT-TYPE is just ignored.

Examples:

(typep ’(1 2 3) ’(proper-list integer)) => T
(typep ’(1 2 3) ’(proper-list string)) => T

Package

trivial-types.

Source

lists.lisp.

Type: property-list (&optional value-type)

Equivalent to ‘(and list (satisfies property-list-p))‘. VALUE-TYPE is just ignored.

Examples:

(typep ’(:a 1 :b 2) ’(property-list integer)) => T (typep ’(:a 1 :b 2) ’(property-list string)) => T

Package

trivial-types.

Source

lists.lisp.

Type: stream-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: string-designator ()
Package

trivial-types.

Source

designators.lisp.

Type: tuple (&rest element-types)

Equivalent to ‘(and list (cons ARG1 (cons ARG2 (cons ARG3 ...))))‘ where ARGn is each element of ELEMENT-TYPES.

Examples:

(typep 1 ’tuple) => NIL
(typep ’(1 . 2) ’tuple) => NIL
(typep ’(1 2 3) ’tuple) => NIL
(typep ’(1 2 3) ’(tuple integer integer)) => NIL
(typep ’(1 2 3) ’(tuple string integer integer)) => NIL (typep nil ’tuple) => T
(typep nil ’(tuple)) => T
(typep ’(1 2 3) ’(tuple integer integer integer)) => T

Package

trivial-types.

Source

lists.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *standard-optimize-qualities*
Package

trivial-types.

Source

specials.lisp.


6.2.2 Macros

Macro: %proper-list-p (var &optional element-type)
Package

trivial-types.

Source

lists.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables


A.4 Data types

Jump to:   A   C   D   F   L   M   N   P   S   T  
Index Entry  Section

A
association-list: Public types

C
character-designator: Public types
combinators.lisp: The trivial-types/src/combinators․lisp file

D
designators.lisp: The trivial-types/src/designators․lisp file

F
File, combinators.lisp: The trivial-types/src/combinators․lisp file
File, designators.lisp: The trivial-types/src/designators․lisp file
File, lists.lisp: The trivial-types/src/lists․lisp file
File, package.lisp: The trivial-types/src/package․lisp file
File, specials.lisp: The trivial-types/src/specials․lisp file
File, streams.lisp: The trivial-types/src/streams․lisp file
File, trivial-types.asd: The trivial-types/trivial-types․asd file
File, typespecs.lisp: The trivial-types/src/typespecs․lisp file
file-associated-stream: Public types
file-position-designator: Public types
function-designator: Public types

L
list-designator: Public types
lists.lisp: The trivial-types/src/lists․lisp file

M
Module, src: The trivial-types/src module

N
non-nil: Public types

P
Package, trivial-types: The trivial-types package
Package, trivial-types-asd: The trivial-types-asd package
package-designator: Public types
package.lisp: The trivial-types/src/package․lisp file
pathname-designator: Public types
proper-list: Public types
property-list: Public types

S
specials.lisp: The trivial-types/src/specials․lisp file
src: The trivial-types/src module
stream-designator: Public types
streams.lisp: The trivial-types/src/streams․lisp file
string-designator: Public types
System, trivial-types: The trivial-types system

T
trivial-types: The trivial-types system
trivial-types: The trivial-types package
trivial-types-asd: The trivial-types-asd package
trivial-types.asd: The trivial-types/trivial-types․asd file
tuple: Public types
Type, association-list: Public types
Type, character-designator: Public types
Type, file-associated-stream: Public types
Type, file-position-designator: Public types
Type, function-designator: Public types
Type, list-designator: Public types
Type, non-nil: Public types
Type, package-designator: Public types
Type, pathname-designator: Public types
Type, proper-list: Public types
Type, property-list: Public types
Type, stream-designator: Public types
Type, string-designator: Public types
Type, tuple: Public types
typespecs.lisp: The trivial-types/src/typespecs․lisp file