Version 0.1.0.
This is the reference document for CLERIC (Common Lisp Erlang Interface).
It describes all symbols exported from the CLERIC
,
CLERIC-BOPS
, and CLERIC-EPMD
packages.
The latest version of this document is available here: http://common-lisp.net/project/cleric/doc/cleric_reference.html
CLERIC is an implementation of the Erlang distribution protocol, making it possible for a Lisp program to act as an Erlang node. Similar libraries exist for other languages; erl_interface for C and jinterface for Java are part of the official Erlang distribution.
The type erlang-translatable contains all types of Lisp objects that may be translated to Erlang objects.
[Standard class]
erlang-binary
Represents an Erlang binary.
[Standard class]
erlang-external-fun
Represents an Erlang external fun.
[Standard class]
erlang-new-internal-fun
Represents an Erlang 'new' internal fun.
[Standard class]
erlang-old-internal-fun
Represents an Erlang internal fun.
Represents an Erlang Pid.
Represents an Erlang Port.
[Standard class]
erlang-reference
Represents an Erlang reference.
Represents an Erlang tuple.
Represents a remote Erlang node.
Exit message object.
Exit2 message object.
Group leader message object.
Link message object.
Node link message object.
Reg send message object.
Send message object.
Unlink message object.
[Generic function]
arity tuple-or-fun => arity
Returns the arity of tuple-or-fun. For tuples that means the number of elements and for Funs the number of arguments.
[Function]
binary &rest
bytes => binary
Creates a new binary from bytes.
[Function]
binary-to-string binary => string
Converts binary to a string.
[Generic function]
bits-in-last-byte binary => number-of-bits
Returns the number of bits used in the last byte of binary.
[Generic function]
bytes binary => bytes
Returns a vector of bytes from binary.
[Function]
bytes-to-binary bytes => binary
Creates a new binary from the byte sequence bytes.
[Function]
connected-remote-nodes => node-names
Returns a list of all the currently connected remote nodes.
[Generic function]
cookie control-message => cookie
Returns the cookie in control-message.
[Function]
decode bytes &key
start version-tag =>
erlang-term, position
Decodes the sequence bytes into Erlang terms. position is the number of bytes consumed from bytes.
[Function]
decode-control-message
bytes &key
start version-tag =>
control-message, position
Decodes the sequence bytes into a Erlang control message. position is the number of bytes consumed from bytes.
[Generic function]
elements tuple => elements
Returns a vector with the elements in tuple.
[Generic function]
encode erlang-translatable-object &key
version-tag
atom-cache-entries => bytes
Encodes erlang-translatable-object into a sequence of bytes.
[Generic function]
encode-control-message control-message &key
version-tag atom-cache-entries => bytes
Encodes control-message into a sequence of bytes.
[Function]
erlang-translatable-p object => boolean
Returns true if object can be encoded to an Erlang term.
[Generic function]
from-pid control-message => pid
Returns the Pid from which control-message was sent.
[Function]
link from-pid to-pid => nil
Establish a process link between from-pid and to-pid. Sends a Link control message to the node where the process to-pid is located.
[Function]
listening-p => boolean
Returns true if currently listening on a server socket.
[Function]
listening-port => port
Returns the port number of the listening (server) socket.
Returns NIL
if not listening on a socket.
[Function]
make-atom string => symbol
Creates a symbol with name string which is interned in the package defined by *atom-symbol-package*.
Creates a Pid object. Useful for sending and receiving messages.
[Function]
match-p object-a object-b => boolean
Returns true if object-a and object-b match.
[Generic function]
message control-message => message
Returns the message part of control-message.
[Generic function]
module erlang-fun => symbol
Returns the module of erlang-fun.
[Generic function]
node erlang-identifier => symbol
Returns the node of erlang-identifier. An Erlang identifier is either a Pid, Port, or a reference object.
[Function]
node-name full-node-name => name
Returns the short node name from full-node-name.
[Function]
node-host full-node-name => host
Returns the node hostname from full-node-name.
[Generic function]
reason exit-control-message => term
Returns the reason of exit-control-message.
[Function]
receive-node-messages &key
timeout =>
control-messages
timeout defaults to
NIL
.Waits for and receives messages from connected nodes. Returns a list of received messages.
[Function]
reg-send from-pid to-name node message => nil
Sends message from from-pid to registered process to-name on node.
[Function]
remote-node-accept-connect cookie => full-node-name
Accept connection from a remote node and perform handshake using cookie.
If the handshake is successful, the node is registered and the full node name is returned.
[Function]
remote-node-connect remote-node cookie => t
Connect and perform handshake with remote-node. If the connection and handshake is successful the node is registered and the full node name is returned.
[Generic function]
remote-node-host remote-node => host-string
Returns the host where remote-node is located.
[Generic function]
remote-node-name remote-node => node-name
Returns the node name of remote-node.
[Generic function]
remote-node-port remote-node => port-number
Returns the port on which remote-node listens.
[Generic function]
remote-node-socket remote-node => socket-object
Returns the usocket socket object used for communicating with remote-node.
[Function]
send to-pid message => nil
Sends message to to-pid.
[Generic function]
size tuple-or-binary => size
Returns the size of tuple-or-binary which means the number of elements in a tuple or the number of bytes in a binary.
[Function]
start-listening => T
Opens a listening (server) socket to which other nodes may connect.
To accept connections from remote nodes, use remote-node-accept-connect
[Function]
start-listening-on-socket-restart condition =>
T
Invokes the
start-listening-on-socket
restart.condition is ignored.
[Function]
stop-listening => NIL
Closes the listening (server) socket.
[Function]
string-to-binary string => binary
Creates a new binary from string.
[Function]
this-node => local-node-name
setf-able function.
Returns the local node name.
[Generic function]
to-name reg-send-control-message => registered-name
Returns the registered process name of the receiver of reg-send-control-message.
[Generic function]
to-pid control-message => pid
Returns the receiving Pid of control-message.
[Generic function]
trace-token control-message => trace-token
Returns the trace token of control-message.
[Function]
try-again-condition-p condition => boolean
Returns true if condition is of type try-again.
[Function]
try-connect-again-restart condition => T
Invokes the
try-connect-again
restart.condition is ignored.
[Function]
tuple &rest
objects => tuple
Creates a new tuple containing objects.
[Function]
unlink from-pid to-pid => nil
Unlinks from-pid and to-pid. Sends an Unlink control message to the node where to-pid is located.
[Special variable]
*atom-symbol-package*
Initial value:
:KEYWORD
Defines the package in which new symbols sent from remote nodes will be interned.
[Special variable]
*erlang-false-is-lisp-nil*
Initial value:
NIL
When true, the symbol
|false|
received from a remote node will be translated toNIL
.
[Special variable]
*erlang-string-is-lisp-string*
Initial value:
NIL
When true, a string received from a remote node will be translated to a string instead of a list of integers.
[Special variable]
*erlang-true-is-lisp-t*
Initial value:
NIL
When true, the symbol
|true|
received from a remote node will be translated toT
.
[Special variable]
*lisp-nil-at-tail-is-erlang-empty-list*
Initial value:
T
When true, translate
NIL
at the tail of a list to an empty list when sending to a remote node.Note: You will most likely never need to change this variable.
[Special variable]
*lisp-nil-is-erlang-empty-list*
Initial value:
T
When true, translate a non-tail
NIL
to an empty list when sending to a remote node.
[Special variable]
*lisp-nil-is-erlang-false*
Initial value:
NIL
When true, translate a non-tail
NIL
to the symbol|false|
when sending to a remote node.
[Special variable]
*lisp-string-is-erlang-binary*
Initial value:
NIL
When true, translate a string to a binary when sending to a remote node.
[Special variable]
*lisp-t-is-erlang-true*
Initial value:
NIL
When true, translate
T
to the symbol|true|
when sending to a remote node.
[Constant variable]
+highest-version-supported+
Value: 5
[Constant variable]
+lowest-version-supported+
Value: 5
[Condition]
already-listening-on-socket
[Condition]
connection-closed-error
[Condition]
handshake-failed-error
[Condition]
malformed-external-erlang-term-error
[Condition]
malformed-message-error
[Condition]
node-unreachable-error
[Condition]
not-implemented-error
[Condition]
not-listening-on-socket
[Condition]
unexpected-message-length-error
[Condition]
unexpected-message-tag-error
[Condition]
untranslatable-lisp-object-error
The CLERIC-BOPS
package contains common byte operation functions
used in CLERIC.
[Function]
bytes-to-signed-int32 bytes &optional
pos =>
signed-int32
pos defaults to
0
.Converts four bytes at position pos in byte vector bytes to a 32-bit signed integer.
[Function]
bytes-to-string bytes &optional
length pos =>
string
length defaults to
NIL
.
pos defaults to0
.Converts bytes at pos in bytes to a string. If length is given, length number of bytes is converted, otherwise all bytes.
[Function]
bytes-to-uint16 bytes &optional
pos =>
uint16
pos defaults to
0
.Converts two bytes at position pos in byte vector bytes to a 16-bit unsigned integer.
[Function]
bytes-to-uint32 bytes &optional
pos =>
uint32
pos defaults to
0
.Converts four bytes at position pos in byte vector bytes to a 32-bit unsigned integer.
[Function]
bytes-to-unsigned-integer
bytes &optional
number-of-bytes pos => uint
number-of-bytes defaults to
NIL
.
pos defaults to0
.Converts number-of-bytes bytes at position pos in byte vector bytes to an unsigned integer.
[Function]
read-bytes n stream => bytes
Reads an n length byte vector from stream.
[Function]
read-bytes-as-string n stream => string
Reads an n length string from stream.
[Function]
read-signed-int32 stream => signed-int32
Reads a 32-bit signed integer (four bytes) from stream.
[Function]
read-uint16 stream => uint16
Reads a 16-bit unsigned integer (two bytes) from stream.
[Function]
read-uint32 stream => uint32
Reads a 32-bit unsigned integer (four bytes) from stream.
[Function]
uint16-to-bytes int => bytes
Converts 16-bit unsigned integer int to a two-byte vector.
[Function]
uint32-to-bytes int => bytes
Converts 32-bit unsigned integer int to a four-byte vector.
[Function]
unsigned-integer-to-bytes uint number-of-bytes => bytes
Converts unsigned integer uint to a vector of bytes of length number-of-bytes.
[Function]
string-to-bytes string => bytes
Converts string to a vector of bytes.
The CLERIC-EPMD
package contains functions and other symbols
related to querying the Erlang Port Mapper Daemon (EPMD).
[Function]
lookup-node node-name &optional
host =>
remote-node
host defaults to
"localhost"
.Queries the EPMD at host for node node-name. If the node exists, a remote-node object is returned representing that node. Otherwise
NIL
is returned.
[Function]
print-all-registered-nodes
&optional
host stream => T
host defaults to
Print to stream the names and listening port for all nodes registered on the EPMD at host."localhost"
.
stream defaults toT
.
Register on the EPMD to become visible to remote nodes.
[Function]
published-p => boolean
Returns true if registered on the EPMD.
Unregister from the EPMD to stop being visible to remote nodes.
[Condition]
already-registered
[Condition]
host-unknown-error