The enhanced-multiple-value-bind Reference Manual

Table of Contents

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

The enhanced-multiple-value-bind Reference Manual

This is the enhanced-multiple-value-bind Reference Manual, version 1.0.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:51:20 2018 GMT+0.


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

1 Introduction

Project's home: http://www.hexstreamsoft.com/projects/enhanced-multiple-value-bind/


enhanced-multiple-value-bind provides an enhanced MULTIPLE-VALUE-BIND
macro that adds support for lambda keywords by expanding to a
MULTIPLE-VALUE-CALL when necessary. This makes catching multiple-value
&rest and &key much more lightweight and convenient. A
MULTIPLE-VALUE-&BIND alias is supported.

Some problems with writing out MULTIPLE-VALUE-CALL with an inline
LAMBDA, especially with a big LAMBDA body and trivial form arguments
to m-v-c, compared to MULTIPLE-VALUE-BIND, are:

- "unnatural" order of evaluation (skip over LAMBDA, evaluate values
  forms, then "come back" for LAMBDA body);

- significant extra indentation for the body.

Multiple-value &rest and &key are currently not being used a lot, but
the awkwardness of using them up to now might have something to do
with this state of affairs. Their usefulness and convenience should
now be reassessed.


If enhanced-mvb:MULTIPLE-VALUE-BIND is invoked without apparent lambda
keywords (symbols beginning with "&"), then it simply expands to
cl:MULTIPLE-VALUE-BIND:

(enhanced-mvb:multiple-value-bind (a b c) (values 1 2 3)
  ...)
==
(multiple-value-bind (a b c) (values 1 2 3)
  ...)

Else, it simply expands to a MULTIPLE-VALUE-CALL with inline LAMBDA:

(enhanced-mvb:multiple-value-bind (a b &rest rest) (values 1 2 3)
  ...)
==
(multiple-value-call (lambda (a b &rest rest)
                       ...)
  (values 1 2 3))

An interesting consequence of this is that it's easy to accept an
exact number of return values (though I'm not sure why you'd want to):

(multiple-value-bind (a b c &optional) (values 1 2 3 4))
error --> "Invalid number of arguments: 4"

This follows the same principle as VALUES in FUNCTION type specifiers.
CLHS VALUES (type specifier):
http://www.lispworks.com/documentation/HyperSpec/Body/t_values.htm


To use enhanced-multiple-value-bind, either refer to the provided
MULTIPLE-VALUE-BIND directly:

;; A bit long...
(enhanced-multiple-value-bind:multiple-value-bind
      (x y &rest others)
    (values 1 2 3 4)
  (values (* x y) others))
=> 2, (3 4)

;; Much more managable package nickname.
(enhanced-mvb:multiple-value-bind (x y &rest others)
    (values 1 2 3 4)
  (values (* x y) others))
=> 2, (3 4)

Or (:shadowing-import-from #:enhanced-multiple-value-bind
#:multiple-value-bind) in your DEFPACKAGE (or with the package
nickname, again). Don't (:use)!

enhanced-multiple-value-bind also exports MULTIPLE-VALUE-&BIND, with
exactly the same functionality, so you can (:import-from
#:enhanced-multiple-value-bind #:multiple-value-&bind) in your
DEFPACKAGE instead if you want.


This library is in the Public Domain.
See the UNLICENSE file for details.


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 enhanced-multiple-value-bind

Author

Jean-Philippe Paradis <hexstream@gmail.com>

License

Public Domain

Description

Provides an enhanced MULTIPLE-VALUE-BIND macro that adds support for lambda keywords by expanding to a MULTIPLE-VALUE-CALL when necessary. This makes catching multiple-value &rest and &key much more lightweight and convenient. A MULTIPLE-VALUE-&BIND alias is supported.

Version

1.0.1

Source

enhanced-multiple-value-bind.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 enhanced-multiple-value-bind.asd

Location

enhanced-multiple-value-bind.asd

Systems

enhanced-multiple-value-bind (system)


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

3.1.2 enhanced-multiple-value-bind/package.lisp

Parent

enhanced-multiple-value-bind (system)

Location

package.lisp

Packages

enhanced-multiple-value-bind


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

3.1.3 enhanced-multiple-value-bind/main.lisp

Dependency

package.lisp (file)

Parent

enhanced-multiple-value-bind (system)

Location

main.lisp

Exported Definitions
Internal Definitions

%expand (function)


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

4 Packages

Packages are listed by definition order.


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

4.1 enhanced-multiple-value-bind

Source

package.lisp (file)

Nickname

enhanced-mvb

Use List

common-lisp

Exported Definitions
Internal Definitions

%expand (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: multiple-value-&bind LAMBDA-LIST VALUES-FORM &body BODY
Package

enhanced-multiple-value-bind

Source

main.lisp (file)

Macro: multiple-value-bind LAMBDA-LIST VALUES-FORM &body BODY
Package

enhanced-multiple-value-bind

Source

main.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: %expand LAMBDA-LIST VALUES-FORM BODY
Package

enhanced-multiple-value-bind

Source

main.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   E   F   L  
Index Entry  Section

E
enhanced-multiple-value-bind.asd: The enhanced-multiple-value-bind<dot>asd file
enhanced-multiple-value-bind/main.lisp: The enhanced-multiple-value-bind/main<dot>lisp file
enhanced-multiple-value-bind/package.lisp: The enhanced-multiple-value-bind/package<dot>lisp file

F
File, Lisp, enhanced-multiple-value-bind.asd: The enhanced-multiple-value-bind<dot>asd file
File, Lisp, enhanced-multiple-value-bind/main.lisp: The enhanced-multiple-value-bind/main<dot>lisp file
File, Lisp, enhanced-multiple-value-bind/package.lisp: The enhanced-multiple-value-bind/package<dot>lisp file

L
Lisp File, enhanced-multiple-value-bind.asd: The enhanced-multiple-value-bind<dot>asd file
Lisp File, enhanced-multiple-value-bind/main.lisp: The enhanced-multiple-value-bind/main<dot>lisp file
Lisp File, enhanced-multiple-value-bind/package.lisp: The enhanced-multiple-value-bind/package<dot>lisp file

Jump to:   E   F   L  

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

A.2 Functions

Jump to:   %  
F   M  
Index Entry  Section

%
%expand: Internal functions

F
Function, %expand: Internal functions

M
Macro, multiple-value-&bind: Exported macros
Macro, multiple-value-bind: Exported macros
multiple-value-&bind: Exported macros
multiple-value-bind: Exported macros

Jump to:   %  
F   M  

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

A.3 Variables


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

A.4 Data types

Jump to:   E   P   S  
Index Entry  Section

E
enhanced-multiple-value-bind: The enhanced-multiple-value-bind system
enhanced-multiple-value-bind: The enhanced-multiple-value-bind package

P
Package, enhanced-multiple-value-bind: The enhanced-multiple-value-bind package

S
System, enhanced-multiple-value-bind: The enhanced-multiple-value-bind system

Jump to:   E   P   S