The hu.dwim.syntax-sugar Reference Manual

This is the hu.dwim.syntax-sugar Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:24:50 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 hu.dwim.syntax-sugar

Various syntax extensions.

Authors

Tamás Borbély <>
Attila Lendvai <>
Levente Mészáros <>

License

BSD or Bugroff

Defsystem Dependency

hu.dwim.asdf (system).

Dependency

hu.dwim.common (system).

Source

hu.dwim.syntax-sugar.asd.

Child Component

source (module).


3 Modules

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


3.1 hu.dwim.syntax-sugar/source

Source

hu.dwim.syntax-sugar.asd.

Parent Component

hu.dwim.syntax-sugar (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 hu.dwim.syntax-sugar/hu.dwim.syntax-sugar.asd

Source

hu.dwim.syntax-sugar.asd.

Parent Component

hu.dwim.syntax-sugar (system).

ASDF Systems

hu.dwim.syntax-sugar.


4.1.2 hu.dwim.syntax-sugar/source/duplicates.lisp

Dependency

package.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Internals

4.1.3 hu.dwim.syntax-sugar/source/feature-cond.lisp

Dependency

one-liners.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

4.1.4 hu.dwim.syntax-sugar/source/case-preserving.lisp

Dependency

syntax-sugar.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

%case-preserving-reader (function).


4.1.5 hu.dwim.syntax-sugar/source/number.lisp

Dependency

syntax-sugar.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

4.1.6 hu.dwim.syntax-sugar/source/one-liners.lisp

Dependency

syntax-sugar.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

sharp-comment-reader (function).


4.1.7 hu.dwim.syntax-sugar/source/package.lisp

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Packages

hu.dwim.syntax-sugar.


4.1.8 hu.dwim.syntax-sugar/source/quasi-quote.lisp

Dependency

one-liners.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

4.1.9 hu.dwim.syntax-sugar/source/readtime-wrapper.lisp

Dependency

one-liners.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

make-readtime-wrapper-reader (function).


4.1.10 hu.dwim.syntax-sugar/source/string-quote.lisp

Dependency

one-liners.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface
Internals

%read-quoted-string (function).


4.1.11 hu.dwim.syntax-sugar/source/syntax-sugar.lisp

Dependency

duplicates.lisp (file).

Source

hu.dwim.syntax-sugar.asd.

Parent Component

source (module).

Public Interface

5 Packages

Packages are listed by definition order.


5.1 hu.dwim.syntax-sugar

Source

package.lisp.

Use List
  • alexandria.
  • anaphora.
  • hu.dwim.common-lisp.
  • iterate.
  • metabang.bind.
Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *quasi-quote-lexical-depth*

The absolute level of read-time (lexical) nesting of the quasi-quote readers. It does not decrease at unquotes.

Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Special Variable: *quasi-quote-nesting-level*

The read-time (lexical) nesting level of the quasi-quote readers, decreases when going through unquotes.

Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Special Variable: *toplevel-readtable*

This is bound to the toplevel *readtable* by all the readers in hu.dwim.syntax-sugar. This is useful for example to restore the original readtable-case at random point in the nested readers.

Package

hu.dwim.syntax-sugar.

Source

syntax-sugar.lisp.


6.1.2 Macros

Macro: define-syntax (name args &body body)
Package

hu.dwim.syntax-sugar.

Source

syntax-sugar.lisp.

Macro: enable-case-preserving-syntax (&key start-character dispatch-character readtable-case packages)
Package

hu.dwim.syntax-sugar.

Source

case-preserving.lisp.

Macro: enable-feature-cond-syntax (&key start-character dispatch-character end-character readtable-case)

Just like CL:COND but at read-time, and in the current package (as opposed to the keyword package as with #+/-).

Package

hu.dwim.syntax-sugar.

Source

feature-cond.lisp.

Macro: enable-quasi-quote-syntax (quasi-quote-wrapper unquote-wrapper &key nested-quasi-quote-wrapper start-character dispatch-character end-character unquote-character splice-character destructive-splice-character dispatched-quasi-quote-name toplevel-reader-wrapper unquote-readtable-case body-reader readtable-case)
Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Macro: enable-readtime-wrapper-syntax (&optional start-character end-character)

A utility read macro for modifying the read table.

The syntax is:

{SPECIFIER ...}

Where SPECIFIER is either a symbol naming a function (available at read time) or a list (SPECIFIER &rest ARGUMENTS). SPECIFIER is applied to ARGUMENTS to produce a function, this is then called and passed another function which reads until the #} character. During the executen of the function *readtable* is bound to a copy of the current read table.

Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Macro: enable-sharp-boolean-syntax ()

This syntax reads "#t" as COMMON-LISP:T and "#f" as COMMON-LISP:NIL

Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Macro: enable-sharp-comment-syntax ()

This syntax allows "#;" to be used to uncomment a whole sexp.

Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Macro: enable-sharp-number-syntax ()
Package

hu.dwim.syntax-sugar.

Source

number.lisp.

Macro: enable-string-quote-syntax (&key start-character end-character transformer)

A simple string quote that unconditionally reads all characters until END-CHARACTER into a string.

Package

hu.dwim.syntax-sugar.

Source

string-quote.lisp.

Macro: with-local-readtable (&body body)

Rebind a copy of *readtable*.

Package

hu.dwim.syntax-sugar.

Source

syntax-sugar.lisp.

Macro: with-standard-readtable (&body body)

Rebind a copy of the standard *readtable*.

Package

hu.dwim.syntax-sugar.

Source

syntax-sugar.lisp.


6.1.3 Ordinary functions

Function: get-macro-character* (char &optional readtable)

Just like CL:GET-MACRO-CHARACTER but its second value defaults to T even if there’s no macro fn installed on CHAR.

Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: list-readers (&optional *readtable*)

A very slow utility for REPL use.

Package

hu.dwim.syntax-sugar.

Source

syntax-sugar.lisp.

Function: set-case-preserving-syntax-in-readtable (&key start-character dispatch-character readtable-case packages)
Package

hu.dwim.syntax-sugar.

Source

case-preserving.lisp.

Function: set-feature-cond-syntax-in-readtable (&key start-character dispatch-character end-character readtable-case)
Package

hu.dwim.syntax-sugar.

Source

feature-cond.lisp.

Function: set-quasi-quote-syntax-in-readtable (quasi-quote-wrapper unquote-wrapper &key nested-quasi-quote-wrapper start-character dispatch-character end-character unquote-character splice-character destructive-splice-character dispatched-quasi-quote-name toplevel-reader-wrapper unquote-readtable-case body-reader readtable-case)
Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Function: set-readtime-wrapper-syntax-in-readtable (&optional start-character end-character)
Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: set-sharp-boolean-syntax-in-readtable ()
Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: set-sharp-comment-syntax-in-readtable ()
Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: set-sharp-number-syntax-in-readtable ()
Package

hu.dwim.syntax-sugar.

Source

number.lisp.

Function: set-string-quote-syntax-in-readtable (&key start-character end-character transformer)
Package

hu.dwim.syntax-sugar.

Source

string-quote.lisp.

Function: with-case-preserving-syntax (&key start-character dispatch-character readtable-case packages)
Package

hu.dwim.syntax-sugar.

Source

case-preserving.lisp.

Function: with-feature-cond-syntax (&key start-character dispatch-character end-character readtable-case)
Package

hu.dwim.syntax-sugar.

Source

feature-cond.lisp.

Function: with-package (package-name)

When used as a specifier for the READTIME-WRAPPER syntax, it locally rebinds at read time the current package to PACKAGE-NAME.

For example, this:

{(with-package :common-lisp) t}

Will always read COMMON-LISP:T, no matter what the current package actually is.

Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: with-preserved-readtable-case ()

See WITH-READTABLE-CASE.

Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: with-quasi-quote-syntax (quasi-quote-wrapper unquote-wrapper &key nested-quasi-quote-wrapper start-character dispatch-character end-character unquote-character splice-character destructive-splice-character dispatched-quasi-quote-name toplevel-reader-wrapper unquote-readtable-case body-reader readtable-case)
Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Function: with-readtable-case (case)

When used as a specifier for the READTIME-WRAPPER syntax, it changes the readtable-case while reading its body. Behaves as an implicit progn.

Example: {(with-readtable-case :preserve) ’fOo} => |fOo|

Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: with-readtime-wrapper-syntax (&optional start-character end-character)
Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: with-sharp-boolean-syntax ()
Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: with-sharp-comment-syntax ()
Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: with-sharp-number-syntax ()
Package

hu.dwim.syntax-sugar.

Source

number.lisp.

Function: with-string-quote-syntax (&key start-character end-character transformer)
Package

hu.dwim.syntax-sugar.

Source

string-quote.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *digits*
Package

hu.dwim.syntax-sugar.

Source

number.lisp.

Special Variable: *dispatched-quasi-quote-name*
Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.


6.2.2 Ordinary functions

Function: %case-preserving-reader (stream readtable-case packages)
Package

hu.dwim.syntax-sugar.

Source

case-preserving.lisp.

Function: %read-feture-cond (*standard-input* end-character readtable-case)
Package

hu.dwim.syntax-sugar.

Source

feature-cond.lisp.

Function: %read-quoted-string (stream end-character transformer)
Package

hu.dwim.syntax-sugar.

Source

string-quote.lisp.

Function: illegal-lambda-list (lambda-list)
Package

hu.dwim.syntax-sugar.

Source

duplicates.lisp.

Function: lambda-list-to-funcall-list (args)
Package

hu.dwim.syntax-sugar.

Source

duplicates.lisp.

Function: lambda-list-to-lambda-list-with-quoted-defaults (args)
Package

hu.dwim.syntax-sugar.

Source

duplicates.lisp.

Function: make-quasi-quote-reader (dispatched-quasi-quote-name previous-reader-on-backtick start-character end-character quasi-quote-wrapper nested-quasi-quote-wrapper unquote-character unquote-wrapper splice-character destructive-splice-character toplevel-reader-wrapper body-reader readtable-case unquote-readtable-case)
Package

hu.dwim.syntax-sugar.

Source

quasi-quote.lisp.

Function: make-readtime-wrapper-reader (end-character)
Package

hu.dwim.syntax-sugar.

Source

readtime-wrapper.lisp.

Function: parse-lambda-list (lambda-list visitor &key macro)
Package

hu.dwim.syntax-sugar.

Source

duplicates.lisp.

Function: process-feature-cond-condition (input-form)
Package

hu.dwim.syntax-sugar.

Source

feature-cond.lisp.

Function: read-rational (stream)

read all decimals as rationals

Package

hu.dwim.syntax-sugar.

Source

number.lisp.

Function: sharp-comment-reader (s c n)
Package

hu.dwim.syntax-sugar.

Source

one-liners.lisp.

Function: sharp-number-reader (stream c n)
Package

hu.dwim.syntax-sugar.

Source

number.lisp.


6.2.3 Generic functions

Generic Reader: lambda-list-of (condition)
Generic Writer: (setf lambda-list-of) (condition)
Package

hu.dwim.syntax-sugar.

Methods
Reader Method: lambda-list-of ((condition illegal-lambda-list))
Writer Method: (setf lambda-list-of) ((condition illegal-lambda-list))
Source

duplicates.lisp.

Target Slot

lambda-list.


6.2.4 Conditions

Condition: illegal-lambda-list
Package

hu.dwim.syntax-sugar.

Source

duplicates.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: lambda-list
Initargs

:lambda-list

Readers

lambda-list-of.

Writers

(setf lambda-list-of).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
D   E   F   G   I   L   M   P   R   S   W  
Index Entry  Section

%
%case-preserving-reader: Private ordinary functions
%read-feture-cond: Private ordinary functions
%read-quoted-string: Private ordinary functions

(
(setf lambda-list-of): Private generic functions
(setf lambda-list-of): Private generic functions

D
define-syntax: Public macros

E
enable-case-preserving-syntax: Public macros
enable-feature-cond-syntax: Public macros
enable-quasi-quote-syntax: Public macros
enable-readtime-wrapper-syntax: Public macros
enable-sharp-boolean-syntax: Public macros
enable-sharp-comment-syntax: Public macros
enable-sharp-number-syntax: Public macros
enable-string-quote-syntax: Public macros

F
Function, %case-preserving-reader: Private ordinary functions
Function, %read-feture-cond: Private ordinary functions
Function, %read-quoted-string: Private ordinary functions
Function, get-macro-character*: Public ordinary functions
Function, illegal-lambda-list: Private ordinary functions
Function, lambda-list-to-funcall-list: Private ordinary functions
Function, lambda-list-to-lambda-list-with-quoted-defaults: Private ordinary functions
Function, list-readers: Public ordinary functions
Function, make-quasi-quote-reader: Private ordinary functions
Function, make-readtime-wrapper-reader: Private ordinary functions
Function, parse-lambda-list: Private ordinary functions
Function, process-feature-cond-condition: Private ordinary functions
Function, read-rational: Private ordinary functions
Function, set-case-preserving-syntax-in-readtable: Public ordinary functions
Function, set-feature-cond-syntax-in-readtable: Public ordinary functions
Function, set-quasi-quote-syntax-in-readtable: Public ordinary functions
Function, set-readtime-wrapper-syntax-in-readtable: Public ordinary functions
Function, set-sharp-boolean-syntax-in-readtable: Public ordinary functions
Function, set-sharp-comment-syntax-in-readtable: Public ordinary functions
Function, set-sharp-number-syntax-in-readtable: Public ordinary functions
Function, set-string-quote-syntax-in-readtable: Public ordinary functions
Function, sharp-comment-reader: Private ordinary functions
Function, sharp-number-reader: Private ordinary functions
Function, with-case-preserving-syntax: Public ordinary functions
Function, with-feature-cond-syntax: Public ordinary functions
Function, with-package: Public ordinary functions
Function, with-preserved-readtable-case: Public ordinary functions
Function, with-quasi-quote-syntax: Public ordinary functions
Function, with-readtable-case: Public ordinary functions
Function, with-readtime-wrapper-syntax: Public ordinary functions
Function, with-sharp-boolean-syntax: Public ordinary functions
Function, with-sharp-comment-syntax: Public ordinary functions
Function, with-sharp-number-syntax: Public ordinary functions
Function, with-string-quote-syntax: Public ordinary functions

G
Generic Function, (setf lambda-list-of): Private generic functions
Generic Function, lambda-list-of: Private generic functions
get-macro-character*: Public ordinary functions

I
illegal-lambda-list: Private ordinary functions

L
lambda-list-of: Private generic functions
lambda-list-of: Private generic functions
lambda-list-to-funcall-list: Private ordinary functions
lambda-list-to-lambda-list-with-quoted-defaults: Private ordinary functions
list-readers: Public ordinary functions

M
Macro, define-syntax: Public macros
Macro, enable-case-preserving-syntax: Public macros
Macro, enable-feature-cond-syntax: Public macros
Macro, enable-quasi-quote-syntax: Public macros
Macro, enable-readtime-wrapper-syntax: Public macros
Macro, enable-sharp-boolean-syntax: Public macros
Macro, enable-sharp-comment-syntax: Public macros
Macro, enable-sharp-number-syntax: Public macros
Macro, enable-string-quote-syntax: Public macros
Macro, with-local-readtable: Public macros
Macro, with-standard-readtable: Public macros
make-quasi-quote-reader: Private ordinary functions
make-readtime-wrapper-reader: Private ordinary functions
Method, (setf lambda-list-of): Private generic functions
Method, lambda-list-of: Private generic functions

P
parse-lambda-list: Private ordinary functions
process-feature-cond-condition: Private ordinary functions

R
read-rational: Private ordinary functions

S
set-case-preserving-syntax-in-readtable: Public ordinary functions
set-feature-cond-syntax-in-readtable: Public ordinary functions
set-quasi-quote-syntax-in-readtable: Public ordinary functions
set-readtime-wrapper-syntax-in-readtable: Public ordinary functions
set-sharp-boolean-syntax-in-readtable: Public ordinary functions
set-sharp-comment-syntax-in-readtable: Public ordinary functions
set-sharp-number-syntax-in-readtable: Public ordinary functions
set-string-quote-syntax-in-readtable: Public ordinary functions
sharp-comment-reader: Private ordinary functions
sharp-number-reader: Private ordinary functions

W
with-case-preserving-syntax: Public ordinary functions
with-feature-cond-syntax: Public ordinary functions
with-local-readtable: Public macros
with-package: Public ordinary functions
with-preserved-readtable-case: Public ordinary functions
with-quasi-quote-syntax: Public ordinary functions
with-readtable-case: Public ordinary functions
with-readtime-wrapper-syntax: Public ordinary functions
with-sharp-boolean-syntax: Public ordinary functions
with-sharp-comment-syntax: Public ordinary functions
with-sharp-number-syntax: Public ordinary functions
with-standard-readtable: Public macros
with-string-quote-syntax: Public ordinary functions


A.4 Data types

Jump to:   C   D   F   H   I   M   N   O   P   Q   R   S  
Index Entry  Section

C
case-preserving.lisp: The hu․dwim․syntax-sugar/source/case-preserving․lisp file
Condition, illegal-lambda-list: Private conditions

D
duplicates.lisp: The hu․dwim․syntax-sugar/source/duplicates․lisp file

F
feature-cond.lisp: The hu․dwim․syntax-sugar/source/feature-cond․lisp file
File, case-preserving.lisp: The hu․dwim․syntax-sugar/source/case-preserving․lisp file
File, duplicates.lisp: The hu․dwim․syntax-sugar/source/duplicates․lisp file
File, feature-cond.lisp: The hu․dwim․syntax-sugar/source/feature-cond․lisp file
File, hu.dwim.syntax-sugar.asd: The hu․dwim․syntax-sugar/hu․dwim․syntax-sugar․asd file
File, number.lisp: The hu․dwim․syntax-sugar/source/number․lisp file
File, one-liners.lisp: The hu․dwim․syntax-sugar/source/one-liners․lisp file
File, package.lisp: The hu․dwim․syntax-sugar/source/package․lisp file
File, quasi-quote.lisp: The hu․dwim․syntax-sugar/source/quasi-quote․lisp file
File, readtime-wrapper.lisp: The hu․dwim․syntax-sugar/source/readtime-wrapper․lisp file
File, string-quote.lisp: The hu․dwim․syntax-sugar/source/string-quote․lisp file
File, syntax-sugar.lisp: The hu․dwim․syntax-sugar/source/syntax-sugar․lisp file

H
hu.dwim.syntax-sugar: The hu․dwim․syntax-sugar system
hu.dwim.syntax-sugar: The hu․dwim․syntax-sugar package
hu.dwim.syntax-sugar.asd: The hu․dwim․syntax-sugar/hu․dwim․syntax-sugar․asd file

I
illegal-lambda-list: Private conditions

M
Module, source: The hu․dwim․syntax-sugar/source module

N
number.lisp: The hu․dwim․syntax-sugar/source/number․lisp file

O
one-liners.lisp: The hu․dwim․syntax-sugar/source/one-liners․lisp file

P
Package, hu.dwim.syntax-sugar: The hu․dwim․syntax-sugar package
package.lisp: The hu․dwim․syntax-sugar/source/package․lisp file

Q
quasi-quote.lisp: The hu․dwim․syntax-sugar/source/quasi-quote․lisp file

R
readtime-wrapper.lisp: The hu․dwim․syntax-sugar/source/readtime-wrapper․lisp file

S
source: The hu․dwim․syntax-sugar/source module
string-quote.lisp: The hu․dwim․syntax-sugar/source/string-quote․lisp file
syntax-sugar.lisp: The hu․dwim․syntax-sugar/source/syntax-sugar․lisp file
System, hu.dwim.syntax-sugar: The hu․dwim․syntax-sugar system