The cl-morse Reference Manual

This is the cl-morse Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:11:37 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-morse

Library for translating ASCII letters to morse code and back.

Author

em7

License

BSD-3clause

Version

1.0.0

Dependency

cl-ppcre (system).

Source

cl-morse.asd.

Child Component

src (module).


3 Modules

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


3.1 cl-morse/src

Source

cl-morse.asd.

Parent Component

cl-morse (system).

Child Component

main.lisp (file).


4 Files

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


4.1 Lisp


4.1.1 cl-morse/cl-morse.asd

Source

cl-morse.asd.

Parent Component

cl-morse (system).

ASDF Systems

cl-morse.


4.1.2 cl-morse/src/main.lisp

Source

cl-morse.asd.

Parent Component

src (module).

Packages

cl-morse.

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 cl-morse

Source

main.lisp.

Use List
  • cl-ppcre.
  • common-lisp.
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 Ordinary functions

Function: morse->string (morsestr &key skip-unknown-chars)

Converts the string with morse code to string with alpha characters. If :skip-unknown-chars is true,
ignores characters which cannot be converted to a alpha. Otherwise signals
’unknown-character condition with unknown-ch reader to get the unknown character. A restart ’skip-character is provided in case you want to e.g. log the characters but skip them.

Package

cl-morse.

Source

main.lisp.

Function: string->morse (str &key skip-unknown-chars)

Converts the string to a morse code. If :skip-unknown-chars is true,
ignores characters which cannot be converted to a morse code. Otherwise signals
’unknown-character condition with unknown-ch reader to get the unknown character. A restart ’skip-character is provided in case you want to e.g. log the characters but skip them.

Package

cl-morse.

Source

main.lisp.


6.1.2 Conditions

Condition: unknown-character

Is signalled when a character is not known and could not be converted to a morse code representation. The character is accessible through ’unknown-ch reader.

Package

cl-morse.

Source

main.lisp.

Direct superclasses

error.

Direct methods

unknown-ch.

Direct slots
Slot: ch

The unknown character itself.

Initargs

:ch

Readers

unknown-ch.

Writers

This slot is read-only.


6.2 Internals


6.2.1 Special variables

Special Variable: *alpha->morse*

Hashtable mapping alpha strings to morse code. Not case sensitive.

Package

cl-morse.

Source

main.lisp.

Special Variable: *morse->alpha*

Hashtable mapping morse code string to alpha.

Package

cl-morse.

Source

main.lisp.

Special Variable: *morselist*

List of tuples alpha morse.

Package

cl-morse.

Source

main.lisp.


6.2.2 Ordinary functions

Function: char->morse (c)

Converts a single character to a morse code. If character could not be converted, signals an error ’unknown-character.
Offers a restart ’skip-character which ignores the character and returns an empty string.

Package

cl-morse.

Source

main.lisp.

Function: init-hashtables ()

Initializes *alpha->morse* and *morse->alpha* hashtables from values in morselist

Package

cl-morse.

Source

main.lisp.

Function: morse->char (morsechr)

Converts one morse code character to alpha character. If character could not be converted, signals an error ’unknown-character. Offers a restart ’skip-character which ignorese the character and returns an empty string.

Package

cl-morse.

Source

main.lisp.

Function: tokenize-string (str)

Returns a list of strings which are morse tokens. The strings are shared with the ‘str‘ parameter. If str cannot be tokenized, returns NULL.

Package

cl-morse.

Source

main.lisp.


6.2.3 Generic functions

Generic Reader: unknown-ch (condition)
Package

cl-morse.

Methods
Reader Method: unknown-ch ((condition unknown-character))
Source

main.lisp.

Target Slot

ch.


Appendix A Indexes


A.1 Concepts