The infix-math Reference Manual

This is the infix-math Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:46:00 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 infix-math

An extensible infix syntax for math in Common Lisp.

Author

Paul M. Rodriguez <>

License

MIT

Defsystem Dependency

asdf-package-system (system).

Dependency

infix-math/infix-math (system).

Source

infix-math.asd.


2.2 infix-math/infix-math

Author

Paul M. Rodriguez <>

License

MIT

Dependencies
Source

infix-math.asd.


2.3 infix-math/symbols

Author

Paul M. Rodriguez <>

License

MIT

Source

infix-math.asd.


2.4 infix-math/data

Author

Paul M. Rodriguez <>

License

MIT

Dependencies
Source

infix-math.asd.


3 Files

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


3.1 Lisp


3.1.1 infix-math/infix-math.asd

Source

infix-math.asd.

Parent Component

infix-math (system).

ASDF Systems

3.1.2 infix-math/infix-math/file-type.lisp

Source

infix-math.asd.

Parent Component

infix-math/infix-math (system).

Packages

infix-math/infix-math.

Public Interface

$ (macro).

Internals

3.1.3 infix-math/symbols/file-type.lisp

Source

infix-math.asd.

Parent Component

infix-math/symbols (system).

Packages

infix-math/symbols.

Public Interface
  • % (compiler macro).
  • % (function).
  • & (compiler macro).
  • & (function).
  • << (compiler macro).
  • << (function).
  • >> (compiler macro).
  • >> (function).
  • ^ (compiler macro).
  • ^ (function).
  • over (compiler macro).
  • over (function).
  • × (compiler macro).
  • × (function).
  • ÷ (compiler macro).
  • ÷ (function).
  • π (symbol macro).
  • (compiler macro).
  • (function).
Internals

3.1.4 infix-math/data/file-type.lisp

Source

infix-math.asd.

Parent Component

infix-math/data (system).

Packages

infix-math/data.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 infix-math/symbols

Source

file-type.lisp.

Use List

common-lisp.

Used By List
Public Interface
  • % (compiler macro).
  • % (function).
  • & (compiler macro).
  • & (function).
  • << (compiler macro).
  • << (function).
  • >> (compiler macro).
  • >> (function).
  • ^ (compiler macro).
  • ^ (function).
  • over (compiler macro).
  • over (function).
  • × (compiler macro).
  • × (function).
  • ÷ (compiler macro).
  • ÷ (function).
  • π (symbol macro).
  • (compiler macro).
  • (function).
Internals

4.2 infix-math/infix-math

Source

file-type.lisp.

Nickname

infix-math

Use List
Public Interface

$ (macro).

Internals

4.3 infix-math/data

Source

file-type.lisp.

Use List
Used By List

infix-math/infix-math.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Symbol macros

Symbol Macro: π
Package

infix-math/symbols.

Source

file-type.lisp.


5.1.2 Macros

Macro: $ (&rest formula)

Compile a mathematical formula in infix notation.

Package

infix-math/infix-math.

Source

file-type.lisp.

Macro: declare-binary-operator (new &body &key)
Package

infix-math/data.

Source

file-type.lisp.

Macro: declare-unary-operator (name)
Package

infix-math/data.

Source

file-type.lisp.

Macro: unary (op arg)

Pretend unary operators are binary operators.

Package

infix-math/data.

Source

file-type.lisp.


5.1.3 Compiler macros

Compiler Macro: % (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: & (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: << (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: >> (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: ^ (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: over (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: × (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: ÷ (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Compiler Macro: (a)
Package

infix-math/symbols.

Source

file-type.lisp.


5.1.4 Ordinary functions

Function: % (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: & (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: << (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: >> (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: ^ (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: operator? (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: over (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: precedence (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: (setf precedence) (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: right-associative? (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: (setf right-associative?) (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: trim-dotted-operator (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: unary? (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: (setf unary?) (operator)
Package

infix-math/data.

Source

file-type.lisp.

Function: × (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: ÷ (a b)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: (a)
Package

infix-math/symbols.

Source

file-type.lisp.


5.1.5 Types

Type: precedence ()
Package

infix-math/data.

Source

file-type.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *order-of-operations*

Basic C-style operator precedence, with some differences.

The use of MIN, MAX, GCD and LCM as infix operators is after Dijkstra (see EWD 1300). Perl 6 is also supposed to use them this way, and I have adopted its precedence levels.

Package

infix-math/data.

Source

file-type.lisp.

Special Variable: *precedence*

Table of operator precedence.

Package

infix-math/data.

Source

file-type.lisp.

Special Variable: *right-associative*
Package

infix-math/data.

Source

file-type.lisp.

Special Variable: *unary*
Package

infix-math/data.

Source

file-type.lisp.


5.2.2 Symbol macros

Symbol Macro: e
Package

infix-math/symbols.

Source

file-type.lisp.

Symbol Macro: i
Package

infix-math/symbols.

Source

file-type.lisp.


5.2.3 Macros

Macro: binary-operator (new old)
Package

infix-math/symbols.

Source

file-type.lisp.

Macro: binary-operators (&body body)
Package

infix-math/symbols.

Source

file-type.lisp.

Macro: nodef (place operator)
Package

infix-math/infix-math.

Source

file-type.lisp.

Macro: unary-operator (new old)
Package

infix-math/symbols.

Source

file-type.lisp.

Macro: unary-operators (&body body)
Package

infix-math/symbols.

Source

file-type.lisp.


5.2.4 Ordinary functions

Function: ash- (i c)
Package

infix-math/symbols.

Source

file-type.lisp.

Function: dotted-operator? (sym)
Package

infix-math/data.

Source

file-type.lisp.

Function: eliminate-common-subexpressions (form &optional env)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: expand-expression (exprs)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: expand-fancy-symbols (form)

Expand -x into (- x) and 2x into (* 2 x).

Literal coefficients have the same precedence as unary operators.

Literal coefficients are assumed to be in base 10.

Package

infix-math/infix-math.

Source

file-type.lisp.

Function: looks-like-operator? (sym)

Does SYM start and end with an operator char?

Package

infix-math/data.

Source

file-type.lisp.

Function: make-node (tree operator)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: operator-char? (c)
Package

infix-math/data.

Source

file-type.lisp.

Function: parse-coefficient (str)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: parse-expression (expression)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: precedence< (op1 op2)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: precedence= (op1 op2)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: save-operator (&key name from right-associative)
Package

infix-math/data.

Source

file-type.lisp.

Function: save-unary-operator (name)
Package

infix-math/data.

Source

file-type.lisp.

Function: shunting-yard (expression)
Package

infix-math/infix-math.

Source

file-type.lisp.

Function: valid? (expression)
Package

infix-math/infix-math.

Source

file-type.lisp.


5.2.5 Types

Type: operator ()
Package

infix-math/data.

Source

file-type.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   $   %   &   (   <   >   ^   ×   ÷    
A   B   C   D   E   F   L   M   N   O   P   R   S   T   U   V  
Index Entry  Section

$
$: Public macros

%
%: Public compiler macros
%: Public ordinary functions

&
&: Public compiler macros
&: Public ordinary functions

(
(setf precedence): Public ordinary functions
(setf right-associative?): Public ordinary functions
(setf unary?): Public ordinary functions

<
<<: Public compiler macros
<<: Public ordinary functions

>
>>: Public compiler macros
>>: Public ordinary functions

^
^: Public compiler macros
^: Public ordinary functions

×
×: Public compiler macros
×: Public ordinary functions

÷
÷: Public compiler macros
÷: Public ordinary functions

: Public compiler macros
: Public ordinary functions

A
ash-: Private ordinary functions

B
binary-operator: Private macros
binary-operators: Private macros

C
Compiler Macro, %: Public compiler macros
Compiler Macro, &: Public compiler macros
Compiler Macro, <<: Public compiler macros
Compiler Macro, >>: Public compiler macros
Compiler Macro, over: Public compiler macros
Compiler Macro, ^: Public compiler macros
Compiler Macro, ×: Public compiler macros
Compiler Macro, ÷: Public compiler macros
Compiler Macro, : Public compiler macros

D
declare-binary-operator: Public macros
declare-unary-operator: Public macros
dotted-operator?: Private ordinary functions

E
eliminate-common-subexpressions: Private ordinary functions
expand-expression: Private ordinary functions
expand-fancy-symbols: Private ordinary functions

F
Function, %: Public ordinary functions
Function, &: Public ordinary functions
Function, (setf precedence): Public ordinary functions
Function, (setf right-associative?): Public ordinary functions
Function, (setf unary?): Public ordinary functions
Function, <<: Public ordinary functions
Function, >>: Public ordinary functions
Function, ash-: Private ordinary functions
Function, dotted-operator?: Private ordinary functions
Function, eliminate-common-subexpressions: Private ordinary functions
Function, expand-expression: Private ordinary functions
Function, expand-fancy-symbols: Private ordinary functions
Function, looks-like-operator?: Private ordinary functions
Function, make-node: Private ordinary functions
Function, operator-char?: Private ordinary functions
Function, operator?: Public ordinary functions
Function, over: Public ordinary functions
Function, parse-coefficient: Private ordinary functions
Function, parse-expression: Private ordinary functions
Function, precedence: Public ordinary functions
Function, precedence<: Private ordinary functions
Function, precedence=: Private ordinary functions
Function, right-associative?: Public ordinary functions
Function, save-operator: Private ordinary functions
Function, save-unary-operator: Private ordinary functions
Function, shunting-yard: Private ordinary functions
Function, trim-dotted-operator: Public ordinary functions
Function, unary?: Public ordinary functions
Function, valid?: Private ordinary functions
Function, ^: Public ordinary functions
Function, ×: Public ordinary functions
Function, ÷: Public ordinary functions
Function, : Public ordinary functions

L
looks-like-operator?: Private ordinary functions

M
Macro, $: Public macros
Macro, binary-operator: Private macros
Macro, binary-operators: Private macros
Macro, declare-binary-operator: Public macros
Macro, declare-unary-operator: Public macros
Macro, nodef: Private macros
Macro, unary: Public macros
Macro, unary-operator: Private macros
Macro, unary-operators: Private macros
make-node: Private ordinary functions

N
nodef: Private macros

O
operator-char?: Private ordinary functions
operator?: Public ordinary functions
over: Public compiler macros
over: Public ordinary functions

P
parse-coefficient: Private ordinary functions
parse-expression: Private ordinary functions
precedence: Public ordinary functions
precedence<: Private ordinary functions
precedence=: Private ordinary functions

R
right-associative?: Public ordinary functions

S
save-operator: Private ordinary functions
save-unary-operator: Private ordinary functions
shunting-yard: Private ordinary functions

T
trim-dotted-operator: Public ordinary functions

U
unary: Public macros
unary-operator: Private macros
unary-operators: Private macros
unary?: Public ordinary functions

V
valid?: Private ordinary functions


A.4 Data types