The parameterized-function Reference Manual

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

The parameterized-function Reference Manual

This is the parameterized-function Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:32:26 2022 GMT+0.

Table of Contents


1 Introduction

                        PARAMETERIZED-FUNCTION
                        ======================

                           By Robert Smith

This package provides functions which can be parameterized, whose
parameters are dispatched at compile time.

Parameterized functions are defined by first declaring the "dispatch
function". For example, if we wanted a general multiply function that
gets dispatched at compile time, we might declare the following:

  (define-dispatch-function mult (xtype ytype) (x y))

Next, we can define several parameterized functions.

  (define-parameterized-function mult (:integer :integer) (x y)
    (* x y))

  (define-parameterized-function mult (:integer :string) (x y)
    (with-output-to-string (s)
      (loop :repeat x
            :do (write-string y s))))

  (define-parameterized-function mult (:string :integer) (y x)
    (with-output-to-string (s)
      (loop :repeat x
            :do (write-string y s))))

  (define-parameterized-function mult (:string :string) (x y)
    (concatenate 'string x y)))

If we call MULT with a constant (quoted) list as the first argument,
then it will be expanded, at compile time, to one of the above
definitions. If the first argument is not constant, then dispatch will
occur at runtime.

2 Systems

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


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

2.1 parameterized-function

Compile-time parameterized functions.

Author

Robert Smith <quad@symbo1ics.com>

License

BSD 3-clause (See LICENSE)

Dependency

interface (system).

Source

parameterized-function.asd.

Child Components

3 Files

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


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

3.1 Lisp


3.1.1 parameterized-function/parameterized-function.asd

Source

parameterized-function.asd.

Parent Component

parameterized-function (system).

ASDF Systems

parameterized-function.


3.1.2 parameterized-function/package.lisp

Dependency

license (file).

Source

parameterized-function.asd.

Parent Component

parameterized-function (system).

Packages

parameterized-function.


3.1.3 parameterized-function/parameterized-function.lisp

Dependency

package.lisp (file).

Source

parameterized-function.asd.

Parent Component

parameterized-function (system).

Public Interface
Internals

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

3.2 Static


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

3.2.1 parameterized-function/LICENSE

Source

parameterized-function.asd.

Parent Component

parameterized-function (system).


4 Packages

Packages are listed by definition order.


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

4.1 parameterized-function

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


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

5.1 Public Interface


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.1 Special variables

Special Variable: *warn-about-dynamic-dispatch*

Enables run-time warnings when dynamic dispatch occurs.

Package

parameterized-function.

Source

parameterized-function.lisp.

Special Variable: *warn-about-non-constant-parameters*

Enables compile-time warnings when dynamic dispatch will occur because of non-constant parameters.

Package

parameterized-function.

Source

parameterized-function.lisp.


5.1.2 Macros

Macro: define-dispatch-function (name (&rest parameters) (&rest args) &key documentation)
Package

parameterized-function.

Source

parameterized-function.lisp.

Macro: define-parameterized-function (name (&rest parameters) (&rest args) &body body)

Define a parameterized function named NAME whose parameter variables are PARAMETERS, whose lambda list is ARGS, and body is BODY.

Package

parameterized-function.

Source

parameterized-function.lisp.


5.2 Internals


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

5.2.1 Ordinary functions

Function: constant-quoted-list-p (l &optional env)
Package

parameterized-function.

Source

parameterized-function.lisp.

Function: dispatch-table-name (name)
Package

parameterized-function.

Source

parameterized-function.lisp.

Function: generate-name-from-parameters (fn params &optional suffix)
Package

parameterized-function.

Source

parameterized-function.lisp.

Function: undispatch-form (form new-function-name)
Package

parameterized-function.

Source

parameterized-function.lisp.


Appendix A Indexes


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

A.1 Concepts