The millet Reference Manual

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

The millet Reference Manual

This is the millet Reference Manual, version 0.5.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:22:53 2022 GMT+0.

Table of Contents


1 Introduction

MILLET 0.0.18

Wrapper of implementation dependent tiny utilities.

Usage

(function-name #'car) => CAR
(lambda-list #'car) => (#:ARG0)
(global-symbolp 'pi) => T

Known altenatives.

function-name

lambda-list

type-specifier-p

type-expand

global-symbol-p

From developer

Product's goal

?

License

MIT

Tested with

Partially supported.

lispworks

Special thanks to Yehouda about #1!

Known issues.

FUNCTION-NAME

LAMBDA-LIST

TYPE-EXPAND

TYPE-SPECIFIER-P


2 Systems

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


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

2.1 millet

Wrapper for implementation dependent tiny utilities.

Author

SATO Shinichi

Source Control

(GIT git@github.com:hyotang666/millet)

Bug Tracker

https://github.com/hyotang666/millet/issues

License

MIT

Long Description

# MILLET 0.0.18
Wrapper of implementation dependent tiny utilities.

## Usage

“‘lisp
(function-name #’car) => CAR
(lambda-list #’car) => (#:ARG0)
(global-symbolp ’pi) => T
“‘

## Known altenatives.
### function-name
* clod - Autodoc generator. Internals.
* [swank](https://github.com/slime/slime) - Backend server of SLIME. Internals.

### lambda-list
* [trivial-arguments](https://github.com/Shinmera/trivial-arguments) - Retrieve the lambda-list of a functioni. Externals.
* clod - Autodoc generator. Internals.
* [swank](https://github.com/slime/slime) - Backend server of SLIME. Internals.

### type-specifier-p
* [trivial-types](https://github.com/m2ym/trivial-types) - Trivial type defintions. Externals.
* [swank](https://github.com/slime/slime) - Backend server of SLIME. Internals.

### type-expand
* [trivial-types](https://github.com/m2ym/trivial-types) - Trivial type defintions. Externals.
* [introspect-environment](https://github.com/Bike/introspect-environment) - Portable but nonstandard introspection of CL environments. Externals.

### global-symbol-p
* [definitions](https://github.com/Shinmera/definitions) - General definitions reflection library. Internals.
* clod - Autodoc generator. Internals.

## From developer
### Product’s goal
?
### License
MIT

### Tested with
* SBCL/2.1.10
* CCL/1.12
* ECL/20.4.24
* CLISP/2.49
* Allegro/10.1
* CLASP/2021-05-26 ; Failed.
* CMUCL/21D
* ABCL/1.8.0

### Partially supported.
#### lispworks

- [ ] function-name
- [x] lambda-list
- [ ] global-symbol-p
- [ ] special-symbol-p
- [x] type-expand
- [x] type-specifier-p
- [ ] test

Special thanks to Yehouda about #1!

### Known issues.
#### FUNCTION-NAME
* Local function name is not supported due to ECL and CMUCL specific issue.
#### LAMBDA-LIST
* Common Lisp macro is not supported due to CLISP and CLASP specific issue.
* Local function is not supported due to ECL specific issue.
* The function which is returned from ‘CL:COMPLEMENT‘ is not supported due to SBCL and ECL specific issue.
* The function which is returned from ‘CL:CONSTANTLY‘ is not supported due to CCL and ECL and CMUCL specific issue.
* Funcallable standard class is not supported due to CCL and ECL and CLASP and ABCL specific issue.
#### TYPE-EXPAND
* ECL may get false positive when invalid type specifier form comes.
#### TYPE-SPECIFIER-P
* ECL has [issue](https://gitlab.com/embeddable-common-lisp/ecl/-/issues/570)
* CLASP has same issue.

Version

0.5.1

Source

millet.asd.

Child Components

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   [Contents][Index]

3.1.1 millet/millet.asd

Source

millet.asd.

Parent Component

millet (system).

ASDF Systems

millet.


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

3.1.2 millet/package.lisp

Source

millet.asd.

Parent Component

millet (system).

Packages

millet.

Internals

3.1.3 millet/sbcl.lisp

If Feature

:sbcl

Dependency

package.lisp (file).

Source

millet.asd.

Parent Component

millet (system).

Public Interface

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

3.1.4 millet/clisp.lisp

If Feature

:clisp

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.5 millet/ecl.lisp

If Feature

:ecl

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.6 millet/ccl.lisp

If Feature

:ccl

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.7 millet/allegro.lisp

If Feature

:allegro

Dependencies
Source

millet.asd.

Parent Component

millet (system).


3.1.8 millet/clasp.lisp

If Feature

:clasp

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.9 millet/lispworks.lisp

If Feature

:lispworks

Dependencies
Source

millet.asd.

Parent Component

millet (system).


3.1.10 millet/cmu.lisp

If Feature

:cmu

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.11 millet/abcl.lisp

If Feature

:abcl

Dependencies
Source

millet.asd.

Parent Component

millet (system).


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

3.1.12 millet/default.lisp

Dependencies
Source

millet.asd.

Parent Component

millet (system).

Public Interface

special-symbol-p (function).

Internals

4 Packages

Packages are listed by definition order.


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

4.1 millet

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


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

5.1 Public Interface


5.1.1 Ordinary functions

Function: function-name (function)

# FUNCTION-NAME

## Description:
accept function, return its name.

“‘lisp
#?(function-name #’car)
=> CAR
“‘

### syntax
(FUNCTION-NAME function)
=> result

## Arguments and Values:
function := function, otherwise error.

“‘lisp
#?(function-name ’car)
:signals error
“‘
result := symbol

## Affected By:
none

## Side-Effects:
none

## Notes:
When lambda function comes, nil is returned.

“‘lisp
#?(function-name #’(lambda () (print :hoge)))
=> NIL
“‘
When local function comes, unspecified.

“‘lisp
#?(function-name (flet ((test () :hoge)) #’test))
=> unspecified
“‘

“‘lisp
#?(function-name (labels ((test () :hoge)) #’test))
=> unspecified
“‘
ECL needs above spec.
Without compile, it works.
But with compile.
not works.
ECL specific two tests above are as observer.
When failed, MILLET needs to change spec or impl.
# Comment out due to error "Defined in a non-null environment.
#+cmu
#?(function-name (compile nil (flet ((test () :hoge)) #’test))) => "LAMBDA NIL" ,:test equal
; not works.

# Comment out since above ECL specific needs.
; CCL specific issue. (macro) returns (:INTERNAL HOGE MACRO).
#?(defmacro macro ()
(flet ((hoge ()))
‘’,(function-name #’hoge)))
=> MACRO
,:before (fmakunbound ’macro)

#?(macro)
=> HOGE

SBCL specific issue. FORMATTER returns e.g. "fmt$~A".
When FORMATTER comes, return NIL.

“‘lisp
#?(function-name (formatter "~A"))
=> NIL
“‘
When setf function comes, (SETF NAME) is returned.

“‘lisp
#?(defclass foo () ((bar :accessor foo-bar)))
:satisfies (lambda ($arg)
(& (typep $arg ’standard-class)
(eq ’foo (class-name $arg))))
, :before
“‘

“‘lisp
#?(function-name (fdefinition ’(setf foo-bar)))
=> (SETF FOO-BAR)
, :test
“‘

## Exceptional-Situations:

Package

millet.

Source

sbcl.lisp.

Function: global-symbol-p (symbol)

# GLOBAL-SYMBOL-P

## Description:
tests arg is global-symbol or not.

“‘lisp
#?(global-symbol-p ’*package*)
=> T
“‘

“‘lisp
#?(let (local)
(declare (ignore local)) (global-symbol-p ’local))
=> NIL
“‘

“‘lisp
#?(global-symbol-p ’car)
=> NIL
“‘

“‘lisp
#?(global-symbol-p :key)
=> T
“‘

### syntax
(GLOBAL-SYMBOL-P symbol)
=> result

## Arguments and Values:
symbol := symbol which is global symbol. result := boolean

## Affected By:
none

## Side-Effects:
none

## Notes:

## Exceptional-Situations:

Package

millet.

Source

sbcl.lisp.

Function: lambda-list (arg)

# LAMBDA-LIST

## Description:
accept function, return its lambda-list

“‘lisp
#?(lambda-list #’lambda-list)
=> (MILLET::ARG)
, :test
“‘

### syntax
(LAMBDA-LIST arg)
=> result

## Arguments and Values:
arg := function designator, otherwise error

“‘lisp
#?(lambda-list :not-function-designator)
:signals error
“‘
result := lambda-list

## Affected By:
none

## Side-Effects:
none

## Notes:

## Exceptional-Situations:
function is not defined, an error is signaled.

“‘lisp
#?(lambda-list ’no-such-function)
:signals error
“‘

## Tests.
Works with generic-function.

“‘lisp
#?(lambda-list ’documentation)
:satisfies (lambda (result)
(& (listp result)
(= 2 (length result))))
“‘
Works with macros.

“‘lisp
#?(defmacro test (a) ‘,a)
=> TEST
, :before
“‘

“‘lisp
#?(lambda-list ’test)
=> (A)
, :test
“‘
Not support CL macros due to clisp can not.

“‘lisp
#?(lambda-list ’when)
=> unspecified
“‘
CLISP specific guard.
Works with lambda.

“‘lisp
#?(lambda-list (lambda (a) a))
=> (A)
, :test
“‘
Works with lambda-form.

“‘lisp
#?(lambda-list ’(lambda (a) a))
=> (A)
, :test
“‘
Not supported local functions due to ECL specific issue.

“‘lisp
#?(lambda-list (flet ((test (a) a)) #’test))
=> unspecified
“‘
ECL specific guard.
Works with ’(setf fun-name).

“‘lisp
#?(lambda-list ’(setf foo-bar))
:satisfies (lambda (result)
(typep result ’(cons symbol (cons symbol null)))) “‘
Works with formatter.

“‘lisp
#?(lambda-list (formatter "~A"))
:satisfies (lambda (result)
(typep result ’(cons symbol *)))
“‘
Not works with complement.

“‘lisp
#?(lambda-list (complement #’car))
=> unspecified
“‘
Due to in SBCL, lambda list will change after compile. Before compile (&REST SB-IMPLE::ARGUMENTS)
After compile (#:G1).
Not works with constantly due to ccl could not.

“‘lisp
#?(lambda-list (constantly nil))
=> unspecified
“‘

“‘lisp
#?(lambda-list (constantly nil))
=> NIL
“‘
Not works with funcallable-standard-class

“‘lisp
#?(defclass fun ()
()
(:metaclass c2mop:funcallable-standard-class))
:be-the c2mop:funcallable-standard-class
, :ignore-signals
“‘
cmu needs.

“‘lisp
#?(let ((fun (make-instance ’fun))) (c2mop:set-funcallable-instance-function fun #’car) (lambda-list fun))
=> unspecified
“‘

“‘lisp
#?(let ((fun (make-instance ’fun))) (c2mop:set-funcallable-instance-function fun #’car) (lambda-list fun))
=> NIL
“‘

“‘lisp
#?(let ((fun (make-instance ’fun))) (c2mop:set-funcallable-instance-function fun #’car) (lambda-list fun))
:signals error
“‘

“‘lisp
#?(let ((fun (make-instance ’fun))) (c2mop:set-funcallable-instance-function fun #’car) (lambda-list fun))
:satisfies (lambda (result)
(& (symbolp result)
(equal "UNBOUND" (symbol-name result))))
“‘

Package

millet.

Source

sbcl.lisp.

Function: special-symbol-p (symbol)

# SPECIAL-SYMBOL-P

## Description:
Tests arg is special symbol or not.

### syntax
(SPECIAL-SYMBOL-P symbol)
=> result

“‘lisp
#?(special-symbol-p ’*package*) => T
“‘

“‘lisp
#?(special-symbol-p ’car)
=> NIL
“‘

“‘lisp
#?(special-symbol-p :keyword) => NIL
“‘

## Arguments and Values:
symbol := symbol, otherwise error.

“‘lisp
#?(special-symbol-p "not symbol") :signals error
“‘
result := boolean

## Affected By:
none

## Side-Effects:
none

## Notes:

## Exceptional-Situations:

Package

millet.

Source

default.lisp.

Function: type-expand (type)

# TYPE-EXPAND

## Description:
expand user defined type specifier.

“‘lisp
#?(deftype function-name ()
’(or function symbol))
=> FUNCTION-NAME
“‘

“‘lisp
#?(type-expand ’function-name)
=> (OR FUNCTION SYMBOL)
, :test
“‘

### syntax
(TYPE-EXPAND type)
=> result

## Arguments and Values:
type := type-specifier, otherwise return arg itself.

“‘lisp
#?(type-expand "not type specifier")
=> "not type specifier"
, :test
“‘
result := 2 values
1. type specifier which may expanded.
2. boolean which represents type specifier is expanded or not.

“‘lisp
#?(type-expand ’function-name)
:values ((OR FUNCTION SYMBOL)
T)
“‘

“‘lisp
#?(type-expand ’symbol)
:values (SYMBOL
NIL)
“‘

“‘lisp
#?(type-expand ’(function-name invalid form))
:values ((FUNCTION-NAME INVALID FORM)
NIL)
“‘

## Affected By:
none

## Side-Effects:
none

## Notes:

## Exceptional-Situations:

Package

millet.

Source

sbcl.lisp.

Function: type-specifier-p (type)

# TYPE-SPECIFIER-P

## Description:
Tests arg is type-specifier or not.

“‘lisp
#?(type-specifier-p ’function-name)
=> T
“‘

“‘lisp
#?(type-specifier-p :not-type-specifier)
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’(unsigned-byte 8))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(mod 4))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(not symbol))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(integer 4 9))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(or symbol string))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(eql 4))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(satisfies listp))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(and list (not null)))
=> T
“‘

“‘lisp
#?(type-specifier-p t)
=> T
“‘

“‘lisp
#?(type-specifier-p nil)
=> T
“‘

“‘lisp
#?(type-specifier-p ’structure-object)
=> T
“‘

#### Added due to CCL specific issue.

“‘lisp
#?(type-specifier-p ’(keyword string))
=> NIL
“‘

#### When CCL is Fixed, code should be modified.

#### Added due to ECL specific issue.

“‘lisp
#?(defstruct (struct (:copier nil) (:predicate nil)))
=> STRUCT
, :before
“‘

“‘lisp
#?(type-specifier-p (make-struct))
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’struct)
=> T
“‘

“‘lisp
#?(typep nil (make-struct))
=> NIL
“‘

#### Added due to ECL specific issue. Already issued in gitlab.

“‘lisp
#?(type-specifier-p ’(t 0))
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’(t))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(function-name invalid specifier form)) => NIL
“‘

“‘lisp
#?(typep nil ’(t 0))
=> T
“‘

#### Cornercase: CMUCL needs.

“‘lisp
#?(type-specifier-p ’(or bit unknown))
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’(or bit symbol))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(not unknown))
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’(not symbol))
=> T
“‘

“‘lisp
#?(type-specifier-p ’(and bit unknown))
=> NIL
“‘

“‘lisp
#?(type-specifier-p ’(and vector string))
=> T
“‘

“‘lisp
#?(type-specifier-p ’keyword)
=> T
“‘

### syntax
(TYPE-SPECIFIER-P type)
=> result

## Arguments and Values:
type := any lisp object.
result := boolean

## Affected By:
none

## Side-Effects:
none

## Notes:

## Exceptional-Situations:

Package

millet.

Source

sbcl.lisp.


5.2 Internals


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

5.2.1 Ordinary functions

Function: already-defined-p (name)
Package

millet.

Source

default.lisp.

Function: canonicalize-type-specifier (specifier)
Package

millet.

Source

package.lisp.

Function: defaultp (symbol)

Is the default function?

Package

millet.

Source

default.lisp.

Function: incomplete (api)
Package

millet.

Source

package.lisp.

Function: mark-as-default (symbol)

Set the mark of the millet default function to symbol-plist.

Package

millet.

Source

default.lisp.

Function: not-support (api)
Package

millet.

Source

package.lisp.


Appendix A Indexes


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

A.1 Concepts


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

A.3 Variables