The letrec Reference Manual

Table of Contents

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

The letrec Reference Manual

This is the letrec Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:54:04 2018 GMT+0.


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

1 Introduction

                                LETREC
                                ======

                             Robert Smith


INTRODUCTION
------------

LETREC:LETREC is a macro which aims to imitate Scheme's letrec
form. It is a useful construct for functional programming in Common
Lisp, where you have function-producing forms which need to be
functionally bound to a symbol.


EXAMPLE
-------

The following code

  (defun multiplier (n)
    (lambda (x) (* n x)))

  (letrec ((double (multiplier 2))
           (triple (multiplier 3)))
    (double (triple 5)))

produces

  30.

Another example:

  (letrec:letrec ((double (multiplier 2)))
    (double (funcall #'double 5)))

produces

  20.


ISSUES
------

Unforunately, the macro isn't a very efficient implementation. There
is a level of indirection with the function calling. Essentially, a
LETREC with the binding

  (name fn)

is expanded to a LABELS binding of the form

  (name (&rest args)
    (apply fn args))

which is somewhat abysmal.

Patches are welcome for implementation-specific ways of implementing
the macro.

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 letrec

Author

Robert Smith <quad@symbo1ics.com>

License

Public Domain. See LICENSE.

Description

A simple alternative to Scheme’s LETREC.

Dependency

alexandria

Source

letrec.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 letrec.asd

Location

letrec.asd

Systems

letrec (system)


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

3.1.2 letrec/package.lisp

Parent

letrec (system)

Location

package.lisp

Packages

letrec


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

3.1.3 letrec/letrec.lisp

Dependency

package.lisp (file)

Parent

letrec (system)

Location

letrec.lisp

Exported Definitions

letrec (macro)

Internal Definitions

check-definitions (function)


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

4 Packages

Packages are listed by definition order.


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

4.1 letrec

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions

letrec (macro)

Internal Definitions

check-definitions (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: letrec (&rest DEFINITIONS) &body BODY

A macro imitation of Scheme’s LETREC. Bindings should be of the form

(NAME FUNCTION-FORM)

where NAME is a symbol and FUNCTION-FORM is any function-producing form.

Package

letrec

Source

letrec.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: check-definitions DEFINITIONS
Package

letrec

Source

letrec.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, letrec.asd: The letrec<dot>asd file
File, Lisp, letrec/letrec.lisp: The letrec/letrec<dot>lisp file
File, Lisp, letrec/package.lisp: The letrec/package<dot>lisp file

L
letrec.asd: The letrec<dot>asd file
letrec/letrec.lisp: The letrec/letrec<dot>lisp file
letrec/package.lisp: The letrec/package<dot>lisp file
Lisp File, letrec.asd: The letrec<dot>asd file
Lisp File, letrec/letrec.lisp: The letrec/letrec<dot>lisp file
Lisp File, letrec/package.lisp: The letrec/package<dot>lisp file

Jump to:   F   L  

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

A.2 Functions

Jump to:   C   F   L   M  
Index Entry  Section

C
check-definitions: Internal functions

F
Function, check-definitions: Internal functions

L
letrec: Exported macros

M
Macro, letrec: Exported macros

Jump to:   C   F   L   M  

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

A.3 Variables


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

A.4 Data types

Jump to:   L   P   S  
Index Entry  Section

L
letrec: The letrec system
letrec: The letrec package

P
Package, letrec: The letrec package

S
System, letrec: The letrec system

Jump to:   L   P   S