The cl-punch Reference Manual

Table of Contents

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

The cl-punch Reference Manual

This is the cl-punch Reference Manual, version 0.1, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 08:22:16 2019 GMT+0.


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

1 Introduction

Cl-Punch - Scala-like anonymous lambda literal

Quicklisp

Usage

;; Enable syntax.
(cl-punch:enable-punch-syntax)

;; ^() is converted into (lambda ...) .
;; Each underscore is converted into a lambda argument.

(mapcar ^(* 2 _) '(1 2 3 4 5))
;; => '(2 4 6 8 10)

;; One underscore corresponds one argument.

(^(* _ _) 2 3)
;; => 6

;; <_ reuses last argument.

(mapcar ^(if (oddp _) (* 2 <_) <_) '(1 2 3 4 5))
;; => '(2 2 6 4 10)

;; _! corresponds one argument but it is brought to top of the argument list.
;; It can be useful when you want to change argument order.

(^(cons _ _!) :a :b)
;; => (:b . :a)

(^(list _! _! _!) 1 2 3)
;; => '(3 2 1)

Installation

WIP: Register to quicklisp

Author

Copyright

Copyright (c) 2018 Windymelt

License

Licensed under the MIT 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-punch

Author

Windymelt

License

MIT

Description

Scala-like anonymous lambda literal

Long Description

# Cl-Punch - Scala-like anonymous lambda literal

[![Quicklisp](http://quickdocs.org/badge/cl-punch.svg)](http://quickdocs.org/cl-punch/)

## Usage

“‘
;; Enable syntax.
(cl-punch:enable-punch-syntax)

;; ^() is converted into (lambda ...) .
;; Each underscore is converted into a lambda argument.

(mapcar ^(* 2 _) ’(1 2 3 4 5))
;; => ’(2 4 6 8 10)

;; One underscore corresponds one argument.

(^(* _ _) 2 3)
;; => 6

;; <_ reuses last argument.

(mapcar ^(if (oddp _) (* 2 <_) <_) ’(1 2 3 4 5))
;; => ’(2 2 6 4 10)

;; _! corresponds one argument but it is brought to top of the argument list.
;; It can be useful when you want to change argument order.

(^(cons _ _!) :a :b)
;; => (:b . :a)

(^(list _! _! _!) 1 2 3)
;; => ’(3 2 1)
“‘

## Installation

WIP: Register to quicklisp

## Author

* Windymelt

## Copyright

Copyright (c) 2018 Windymelt

## License

Licensed under the MIT License.

Version

0.1

Dependency

cl-syntax

Source

cl-punch.asd (file)

Component

src (module)


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

3 Modules

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


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

3.1 cl-punch/src

Parent

cl-punch (system)

Location

src/

Component

cl-punch.lisp (file)


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

4 Files

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


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

4.1 Lisp


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

4.1.1 cl-punch.asd

Location

cl-punch.asd

Systems

cl-punch (system)

Packages

cl-punch-asd


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

4.1.2 cl-punch/src/cl-punch.lisp

Parent

src (module)

Location

src/cl-punch.lisp

Packages

cl-punch

Exported Definitions
Internal Definitions

punch-syntax (special variable)


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

5 Packages

Packages are listed by definition order.


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

5.1 cl-punch-asd

Source

cl-punch.asd

Use List

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

5.2 cl-punch

Source

cl-punch.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

punch-syntax (special variable)


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

6 Definitions

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


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

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Macros

Macro: enable-punch-syntax ()
Package

cl-punch

Source

cl-punch.lisp (file)


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

6.1.2 Functions

Function: punch-reader S C

A reader which converts _ into lambda argument, <_ into last lambda argument.

Package

cl-punch

Source

cl-punch.lisp (file)


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

6.2 Internal definitions


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

6.2.1 Special variables

Special Variable: punch-syntax
Package

cl-punch

Source

cl-punch.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
cl-punch.asd: The cl-punch<dot>asd file
cl-punch/src: The cl-punch/src module
cl-punch/src/cl-punch.lisp: The cl-punch/src/cl-punch<dot>lisp file

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

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

M
Module, cl-punch/src: The cl-punch/src module

Jump to:   C   F   L   M  

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

A.2 Functions

Jump to:   E   F   M   P  
Index Entry  Section

E
enable-punch-syntax: Exported macros

F
Function, punch-reader: Exported functions

M
Macro, enable-punch-syntax: Exported macros

P
punch-reader: Exported functions

Jump to:   E   F   M   P  

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

A.3 Variables

Jump to:   P   S  
Index Entry  Section

P
punch-syntax: Internal special variables

S
Special Variable, punch-syntax: Internal special variables

Jump to:   P   S  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

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

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

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

Jump to:   C   P   S