The pseudonyms Reference Manual

Table of Contents

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

The pseudonyms Reference Manual

This is the pseudonyms Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:12:12 2018 GMT+0.


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

1 Introduction

pseudonyms

A reader-macro way to create non-destructive nicknames within portable Common Lisp

I found that Lisp nicknames, as defined in CLHS, have a few problems that I will count here.

The solution I provide here is a different approach to nicknames that does not use any of the original nickname code, as defined in CLHS.

To begin quickly:

> (pseudonyms:pseudonyms-on)

Pseudonyms, in opposition to nicknames, can be defined by the user inside one's code, like this:

> (defpseudonym :longpackagename "lpn")

And removed like this:

> (pmakunbound "lpn") ;; OR (pmakunbound :longpackagename)

From within the code, one can refer to a pseudonymized package this way:

> $lpn:something

A reader macro will automatically translate it to its normal version of longpackagename:something. This is usable both within the REPL and within usual code.

The reader macro character is also settable from the default #\$:

> (set-pseudonym-macro-character #\^)

All pseudonyms are local to the current package: for instance, pseudonyms defined within CL-USER are not usable anywhere outside the CL-USER package.

An utility function print-pseudonyms will print all pseudonyms for a given package. If not supplied a package name as an argument, it will print all pseudonyms for current package (as shown by the *package* global variable).


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 pseudonyms

Author

Michal "phoe" Herda

License

FreeBSD (BSD 2-clause)

Description

Relative package nicknames through macros

Dependencies
Source

pseudonyms.asd (file)

Components

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

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

3.1.1 pseudonyms.asd

Location

pseudonyms.asd

Systems

pseudonyms (system)


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

3.1.2 pseudonyms/package.lisp

Parent

pseudonyms (system)

Location

package.lisp

Packages

pseudonyms


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

3.1.3 pseudonyms/pseudonyms.lisp

Dependency

package.lisp (file)

Parent

pseudonyms (system)

Location

pseudonyms.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 pseudonyms

=== PSEUDONYMS by phoe ===

See attached README.md for documentation.

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Special variables

Special Variable: *pseudonym-table*

This is a global package-name-indexed hashtable holding package-name-and-pseudonym plists.

Package

pseudonyms

Source

pseudonyms.lisp (file)


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

5.1.2 Functions

Function: defpseudonym PACKAGE PSEUDONYM &key INSIDE-PACKAGE

This, given a package name and a pseudonym for it, allows you to use a local pseudonym in form $pseudonym:symbol instead of name:symbol within your code. This pseudonym is local to the package you called defpseudonym in (as shown by the global variable *PACKAGE*).

Arguments must be a pair of non-empty non-equal string designators, although I suggest using a lowercase string for the second argument.
An optional third argument allows you to set a pseudonym for a different package.

This will signal an error whenever a nickname or pseudonym is already taken.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: pmakunbound DATUM &key INSIDE-PACKAGE

This, given either a pseudonym-bound package name or a package name-bound pseudonym, clears any name-pseudonym pair bound to it.

Argument must be a string designator.
An optional second argument allows you to clear a pseudonym for a different package.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: print-pseudonyms &key INSIDE-PACKAGE

This prints all pseudonyms in a fancy manner.
Optional argument designates the package name, from inside which pseudonyms should be printed.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: pseudonym-reader STREAM CHAR

This is the reader macro for local pseudonyms.

This function is not meant to be called explicitly, unless you know what you’re doing.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: set-pseudonym-macro-character CHAR

Sets the macro character for nickname resolution. By default, it is set to #$.

Package

pseudonyms

Source

pseudonyms.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: pseudonyms-on ()

Gimme some sugar, baby.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: string=-getf PLIST INDICATOR

This is a version of getf utilizing string= for comparison. Given a plist and a key, returns a value.

Package

pseudonyms

Source

pseudonyms.lisp (file)

Function: string=-getf-key PLIST INDICATOR

This is a version of getf utilizing string= for comparison. Given a plist and a value, returns a key.

Package

pseudonyms

Source

pseudonyms.lisp (file)


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

5.2.2 Types

Type: string-designator ()
Package

pseudonyms

Source

pseudonyms.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   P  
Index Entry  Section

F
File, Lisp, pseudonyms.asd: The pseudonyms<dot>asd file
File, Lisp, pseudonyms/package.lisp: The pseudonyms/package<dot>lisp file
File, Lisp, pseudonyms/pseudonyms.lisp: The pseudonyms/pseudonyms<dot>lisp file

L
Lisp File, pseudonyms.asd: The pseudonyms<dot>asd file
Lisp File, pseudonyms/package.lisp: The pseudonyms/package<dot>lisp file
Lisp File, pseudonyms/pseudonyms.lisp: The pseudonyms/pseudonyms<dot>lisp file

P
pseudonyms.asd: The pseudonyms<dot>asd file
pseudonyms/package.lisp: The pseudonyms/package<dot>lisp file
pseudonyms/pseudonyms.lisp: The pseudonyms/pseudonyms<dot>lisp file

Jump to:   F   L   P  

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

A.2 Functions

Jump to:   D   F   P   S  
Index Entry  Section

D
defpseudonym: Exported functions

F
Function, defpseudonym: Exported functions
Function, pmakunbound: Exported functions
Function, print-pseudonyms: Exported functions
Function, pseudonym-reader: Exported functions
Function, pseudonyms-on: Internal functions
Function, set-pseudonym-macro-character: Exported functions
Function, string=-getf: Internal functions
Function, string=-getf-key: Internal functions

P
pmakunbound: Exported functions
print-pseudonyms: Exported functions
pseudonym-reader: Exported functions
pseudonyms-on: Internal functions

S
set-pseudonym-macro-character: Exported functions
string=-getf: Internal functions
string=-getf-key: Internal functions

Jump to:   D   F   P   S  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*pseudonym-table*: Exported special variables

S
Special Variable, *pseudonym-table*: Exported special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

P
Package, pseudonyms: The pseudonyms package
pseudonyms: The pseudonyms system
pseudonyms: The pseudonyms package

S
string-designator: Internal types
System, pseudonyms: The pseudonyms system

T
Type, string-designator: Internal types

Jump to:   P   S   T