Browse Source

khfghcvhgjkfhdxbcnhj

master
Michał Herda 4 years ago
parent
commit
100f18ced8
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      README.md

+ 7
- 2
README.md View File

@@ -11,12 +11,12 @@ The solution I provide here is a different approach to nicknames that does not u

Pseudonyms, in opposition to nicknames, can be defined by the user inside one's code, like this:
```common-lisp
> (defpseudonym "longpackagename" "lpn")
> (defpseudonym :longpackagename "lpn")
```

And removed like this:
```common-lisp
> (pmakunbound "lpn") ;; OR (pmakunbound "longpackagename")
> (pmakunbound "lpn") ;; OR (pmakunbound :longpackagename)
```

From within the code, one can refer to a pseudonymized package this way:
@@ -25,6 +25,11 @@ From within the code, one can refer to a pseudonymized package this way:
```
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:
```common-lisp
> (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).

Loading…
Cancel
Save