The cl-anonfun Reference Manual

Table of Contents

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

The cl-anonfun Reference Manual

This is the cl-anonfun Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 13:23:51 2018 GMT+0.


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

1 Introduction

cl-anonfun

cl-anonfun is a Common Lisp library that provides a simple anonymous function notation.

Usage

fn

fn form => lambda-form

fn macro returns lambda form of anonymous function form. If special symbols starting with % are found in form, its symbols will be placed to lambda-list of lambda form. Special symbol % represents its first argument. Special symbol formed %<n> represents its n'th argument. Special symbol %& represents its rest of arguments.

Examples

(macroexpand '(fn (* % %)))
; => #'(LAMBDA (%) (* % %))

(funcall (fn (* % %)) 3)
; => 9

(macroexpand '(fn (mapcar %2 %1)))
; => #'(LAMBDA (%1 %2) (MAPCAR %2 %1))

(funcall (fn (mapcar %2 %1)) '(1 2 3) (fn (* % %)))
; => 1 4 9

(macroexpand '(fn (apply #'+ 1 2 3 %&)))
; => #'(LAMBDA (&REST %&) (APPLY #'+ 1 2 3 %&))

(funcall (fn (apply #'+ 1 2 3 %&)) 4 5)
; => 15

fnn

fnn narg form => lambda-form

Like fn except that fnn macro can take the number of arguments of the anonymous function.

Examples

(macroexpand '(fnn 3 (eq %2 1)))
; => #'(LAMBDA (#:IGNORE_1_846 %2 #:IGNORE_3_847)
         (DECLARE (IGNORE #:IGNORE_1_846 #:IGNORE_3_847))
         (EQ %2 1))

(funcall (fnn 3 (eq %2 1)) 3 1 2)
; => T

enable-fn-syntax

enable-fn-syntax

By calling this function, you can use special syntax #%(...) instead of fn macro. Any forms of fn macro can be used. If an integer is suppied after #%, fnn macro will be used with the integer instead of fn.

Examples

(enable-fn-syntax)
(funcall #%(* % %) 3)
; => 9

(funcall #%3(eq %2 1) 3 1 2)
; => T

License

Copyright (C) 2011 Tomohiro Matsuyama <tomo@cx4a.org>. 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 cl-anonfun

Author

Tomohiro Matsuyama

License

LLGPL

Description

Anonymous function helpers for Common Lisp

Version

0.1

Source

cl-anonfun.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 cl-anonfun.asd

Location

cl-anonfun.asd

Systems

cl-anonfun (system)

Packages

cl-anonfun-asd


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

3.1.2 cl-anonfun/package.lisp

Parent

cl-anonfun (system)

Location

package.lisp

Packages

cl-anonfun


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

3.1.3 cl-anonfun/anonfun.lisp

Dependency

package.lisp (file)

Parent

cl-anonfun (system)

Location

anonfun.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 cl-anonfun-asd

Source

cl-anonfun.asd

Use List

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

4.2 cl-anonfun

Source

package.lisp (file)

Nickname

anonfun

Use List

common-lisp

Exported Definitions
Internal Definitions

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: enable-fn-syntax ()
Package

cl-anonfun

Source

anonfun.lisp (file)

Macro: fn FORM
Package

cl-anonfun

Source

anonfun.lisp (file)

Macro: fnn NARG FORM
Package

cl-anonfun

Source

anonfun.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: %enable-fn-syntax ()
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: arg-num ARG
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: arg-p ARG
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: extract-args BODY
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: fn-reader STREAM SUB-CHAR NUMARG
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: make-fn NARG FORM
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: make-ignore-vars-between START END
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: make-lambda-list NARG ARGS
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: sort-args ARGS
Package

cl-anonfun

Source

anonfun.lisp (file)

Function: symbol= A B

Package insensitive symbol comparison.

Package

cl-anonfun

Source

anonfun.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-anonfun.asd: The cl-anonfun<dot>asd file
cl-anonfun/anonfun.lisp: The cl-anonfun/anonfun<dot>lisp file
cl-anonfun/package.lisp: The cl-anonfun/package<dot>lisp file

F
File, Lisp, cl-anonfun.asd: The cl-anonfun<dot>asd file
File, Lisp, cl-anonfun/anonfun.lisp: The cl-anonfun/anonfun<dot>lisp file
File, Lisp, cl-anonfun/package.lisp: The cl-anonfun/package<dot>lisp file

L
Lisp File, cl-anonfun.asd: The cl-anonfun<dot>asd file
Lisp File, cl-anonfun/anonfun.lisp: The cl-anonfun/anonfun<dot>lisp file
Lisp File, cl-anonfun/package.lisp: The cl-anonfun/package<dot>lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   %  
A   E   F   M   S  
Index Entry  Section

%
%enable-fn-syntax: Internal functions

A
arg-num: Internal functions
arg-p: Internal functions

E
enable-fn-syntax: Exported macros
extract-args: Internal functions

F
fn: Exported macros
fn-reader: Internal functions
fnn: Exported macros
Function, %enable-fn-syntax: Internal functions
Function, arg-num: Internal functions
Function, arg-p: Internal functions
Function, extract-args: Internal functions
Function, fn-reader: Internal functions
Function, make-fn: Internal functions
Function, make-ignore-vars-between: Internal functions
Function, make-lambda-list: Internal functions
Function, sort-args: Internal functions
Function, symbol=: Internal functions

M
Macro, enable-fn-syntax: Exported macros
Macro, fn: Exported macros
Macro, fnn: Exported macros
make-fn: Internal functions
make-ignore-vars-between: Internal functions
make-lambda-list: Internal functions

S
sort-args: Internal functions
symbol=: Internal functions

Jump to:   %  
A   E   F   M   S  

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

A.3 Variables


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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-anonfun: The cl-anonfun system
cl-anonfun: The cl-anonfun package
cl-anonfun-asd: The cl-anonfun-asd package

P
Package, cl-anonfun: The cl-anonfun package
Package, cl-anonfun-asd: The cl-anonfun-asd package

S
System, cl-anonfun: The cl-anonfun system

Jump to:   C   P   S