The cl-syntax Reference Manual

Table of Contents

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

The cl-syntax Reference Manual

This is the cl-syntax Reference Manual, version 0.3, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:34:42 2018 GMT+0.


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

1 Introduction

CL-SYNTAX

CL-SYNTAX provides Reader Syntax Coventions for Common Lisp and SLIME.

Overview

The well-known problem about reader macros is that SLIME can't handle these reader macros correctly. Consider the following code:

(defpackage foo
  (:use :cl))
(in-package :foo)
(cl-interpol:enable-interpol-syntax)

(list #?"Current Time: ${(get-universal-time)}")

By calling cl-interpol:enable-interpol-syntax, we can use a reader macro #?. However, actually, when we try to evaluate the last line, SLIME reports an error there is no such the reader macro #?. This error might be raised on most of Common Lisp implementations except SBCL.

The goal of CL-SYNTAX is to solve these problems. Instead of using procedurally defined functions such like enable-something-syntax, we introduce syntactically and declaratively defined syntax data structure. With this data structure, we can handle *readtable* correctly and readtables of swank server.

Usage

Macro: defsyntax

defsyntax name &body options

defsyntax defines a new syntax. name is a symbol and options is a list of option.

If option formed (:macro-character char fn &optional non-terminating-p), the syntax engine will call set-macro-character with the arguments when enabling the syntax.

If option formed (:dispatch-macro-character disp-ch sub-ch fn), the syntax engine will call set-dispatch-macro-character with the arguments when enabling the syntax.

Here is an example:

;; Define cl-interpol syntax
(defsyntax interpol-syntax
  (:dispatch-macro-character #\# #\? #'cl-interpol::interpol-reader))

This code is equivalent to:

(defvar interpol-syntax
    `((:dispatch-macro-character #\# #\? ,#'cl-interpol::interpol-reader)))

If you don't want to use defsyntax in some reasons, use this code instead.

Macro: use-syntax

use-syntax syntax-to-use

use-syntax enables the syntax specified by syntax-to-use. syntax-to-use is a symbol which is defined by defsyntax.

Here is an example:

;; use cl-interpol syntax defined before
(use-syntax interpol-syntax)

Copyright (C) 2011-2015 Tomohiro Matsuyama <m2ym.pub@gmail.com>


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-syntax

Author

Tomohiro Matsuyama

License

LLGPL

Description

Reader Syntax Coventions for Common Lisp and SLIME

Version

0.3

Dependencies
Source

cl-syntax.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-syntax/src

Parent

cl-syntax (system)

Location

src/

Components

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

Location

cl-syntax.asd

Systems

cl-syntax (system)

Packages

cl-syntax-asd


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

4.1.2 cl-syntax/src/packages.lisp

Parent

src (module)

Location

src/packages.lisp

Packages

cl-syntax


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

4.1.3 cl-syntax/src/specials.lisp

Dependency

packages.lisp (file)

Parent

src (module)

Location

src/specials.lisp

Internal Definitions

*standard-package-syntax-name* (special variable)


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

4.1.4 cl-syntax/src/types.lisp

Dependency

specials.lisp (file)

Parent

src (module)

Location

src/types.lisp

Exported Definitions

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

4.1.5 cl-syntax/src/operators.lisp

Dependency

types.lisp (file)

Parent

src (module)

Location

src/operators.lisp

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 cl-syntax-asd

Source

cl-syntax.asd

Use List

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

5.2 cl-syntax

Source

packages.lisp (file)

Nickname

syntax

Use List
Exported Definitions
Internal Definitions

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: define-package-syntax &body PACKAGE
Package

cl-syntax

Source

operators.lisp (file)

Macro: defsyntax NAME &body OPTIONS
Package

cl-syntax

Source

operators.lisp (file)

Macro: use-syntax NAME
Package

cl-syntax

Source

operators.lisp (file)


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

6.1.2 Functions

Function: find-syntax NAME
Package

cl-syntax

Source

operators.lisp (file)


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

6.1.3 Types

Type: syntax ()
Package

cl-syntax

Source

types.lisp (file)

Type: syntax-designator ()
Package

cl-syntax

Source

types.lisp (file)


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

6.2 Internal definitions


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

6.2.1 Special variables

Special Variable: *standard-package-syntax-name*
Package

cl-syntax

Source

specials.lisp (file)


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

6.2.2 Functions

Function: %use-syntax NAMES
Package

cl-syntax

Source

operators.lisp (file)

Function: get-options NAME

Get the options list for name, if it is available.

Package

cl-syntax

Source

operators.lisp (file)

Function: package-syntax-name PACKAGE
Package

cl-syntax

Source

operators.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-syntax.asd: The cl-syntax<dot>asd file
cl-syntax/src: The cl-syntax/src module
cl-syntax/src/operators.lisp: The cl-syntax/src/operators<dot>lisp file
cl-syntax/src/packages.lisp: The cl-syntax/src/packages<dot>lisp file
cl-syntax/src/specials.lisp: The cl-syntax/src/specials<dot>lisp file
cl-syntax/src/types.lisp: The cl-syntax/src/types<dot>lisp file

F
File, Lisp, cl-syntax.asd: The cl-syntax<dot>asd file
File, Lisp, cl-syntax/src/operators.lisp: The cl-syntax/src/operators<dot>lisp file
File, Lisp, cl-syntax/src/packages.lisp: The cl-syntax/src/packages<dot>lisp file
File, Lisp, cl-syntax/src/specials.lisp: The cl-syntax/src/specials<dot>lisp file
File, Lisp, cl-syntax/src/types.lisp: The cl-syntax/src/types<dot>lisp file

L
Lisp File, cl-syntax.asd: The cl-syntax<dot>asd file
Lisp File, cl-syntax/src/operators.lisp: The cl-syntax/src/operators<dot>lisp file
Lisp File, cl-syntax/src/packages.lisp: The cl-syntax/src/packages<dot>lisp file
Lisp File, cl-syntax/src/specials.lisp: The cl-syntax/src/specials<dot>lisp file
Lisp File, cl-syntax/src/types.lisp: The cl-syntax/src/types<dot>lisp file

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

Jump to:   C   F   L   M  

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

A.2 Functions

Jump to:   %  
D   F   G   M   P   U  
Index Entry  Section

%
%use-syntax: Internal functions

D
define-package-syntax: Exported macros
defsyntax: Exported macros

F
find-syntax: Exported functions
Function, %use-syntax: Internal functions
Function, find-syntax: Exported functions
Function, get-options: Internal functions
Function, package-syntax-name: Internal functions

G
get-options: Internal functions

M
Macro, define-package-syntax: Exported macros
Macro, defsyntax: Exported macros
Macro, use-syntax: Exported macros

P
package-syntax-name: Internal functions

U
use-syntax: Exported macros

Jump to:   %  
D   F   G   M   P   U  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*standard-package-syntax-name*: Internal special variables

S
Special Variable, *standard-package-syntax-name*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   C   P   S   T  
Index Entry  Section

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

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

S
syntax: Exported types
syntax-designator: Exported types
System, cl-syntax: The cl-syntax system

T
Type, syntax: Exported types
Type, syntax-designator: Exported types

Jump to:   C   P   S   T