Next: Overview

Prev: (dir)

Coldmud is a multi-user network server featuring an object-oriented database and programming language. This Info file documents the Coldmud server version 0.10 and the C-- programming language.

This manual does not document the features of any Coldmud object database, or any object database's interface for defining methods on objects.

Menu:

Overview
Overview of Coldmud
Objects
Objects in Coldmud
Defining Methods
Writing methods in C--
Errors
Error conditions in Coldmud
Function Descriptions
Descriptions of Coldmud functions
Administration
Running and maintaining the server

Function Index
Index of built-in Coldmud functions
Concept Index
Index of concepts

-- The Detailed Node Listing ---

Objects in Coldmud

Dbrefs
Database references
Inheritance
Parents and inheritance
Messages
Interactions between objects
Variables and Parameters
Information stored in objects
System Object
The system object

Methods: Writing methods in C--

Example Method
Example of a C-- method
Tokens
The building blocks of methods
Method Structure
Structure of a method
Statements
Telling the interpreter what to do
Expressions
Expressing values in C--

Statements: Telling the interpreter what to do

Simple Statements
Performing simple actions
Conditional Statements
Executing instructions conditionally
Looping Statements
Executing instructions repeatedly
Error-Handling Statements
Handling errors

Expressions: Expressing values in methods

Data Types
Data types and literal expressions
Names
Referring to objects indirectly
Lists
Constructing and retrieving from lists
Dictionaries
Associating values with data
Buffers
Raw byte values for network I/O
Frobs
Constructing and using frobs
Variables
Local and object variables
Operators
Operator syntax and precedence
Calling Functions
Making calls to built-in functions
Sending Messages
Sending messages to other objects
Passing Messages
Passing messages to parents
Error-Handling Expressions
Handling errors
Splicing
Splicing lists into argument lists

Operators: Operator syntax and precedence

Precedence
Resolving ambiguous expressions
Arithmetic
Arithmetic operators
Logic
Logical and relational operators
Conditional Operators
Conditional operators

Function Descriptions: Descriptions of Coldmud Functions

Data Functions
Operations on data in general
String Functions
Operations on strings
List Functions
Operations on lists
Dictionary Functions
Operations on dictionaries
Buffer Functions
Operations on buffers
Method Functions
Information about the current method
Error Functions
Handling errors
Communication Functions
Communicating with the user
Object Functions
Operations on the current object
Administrative Functions
Privileged operations
Miscellaneous Functions
Miscellaneous operations

Data Functions: Operations on data in general

todbref
Convert an integer or string to a dbref
toerr
Convert a string to an error code
toint
Convert a string or dbref to an integer
tostr
Convert any data to a string
tosym
Convert a string to a symbol
type
Retrieve the type of a piece of data
valid
Check if data is a valid dbref

String Functions: Operations on strings

crypt
Perform one-way encryption on a string
explode
Get a list of words in a string
lowercase
Convert a string to lowercase
match_begin
Match against the beginnings of words
match_pattern
Match against a wildcard pattern
match_regexp
Match against a regular expression
match_template
Match against a command template
pad
Pad a string to a given length
strcmp
Case-sensitive comparison of two strings
strlen
Get the length of a string
strsub
Substitute text within a string
substr
Get a substring of a string
uppercase
Convert a string to uppercase

List Functions: Operations on lists

delete
Delete an element of a list
insert
Insert an element in a list
listlen
Get the length of a list
replace
Replace an element in a list
setadd
Add an element to a "set"
setremove
Remove an element from a "set"
sublist
Get a sublist of a list

Dictionary Functions: Operations on dictionaries

dict_add
Add an association to a dictionary
dict_add_elem
Add an element to a list value
dict_contains
Determine if a key is in a dictionary
dict_del
Delete an association to a dictionary
dict_del_elem
Remove an element from a list value
dict_keys
Get a list of keys in a dictionary

Buffer Functions: Operations on buffers

buffer_add
Add a byte value to the end of a buffer
buffer_append
Append two buffers together
buffer_from_strings
Convert a list of strings into a buffer
buffer_len
Get the length of a buffer
buffer_replace
Replace a byte value in a buffer
buffer_retrieve
Retrieve a byte value from a buffer
buffer_to_strings
Convert a buffer to a list of strings
buffer_truncate
Truncate a buffer to a length

Method Functions: Information about the current method

caller
The definer of the calling method
definer
The definer of the current method
sender
The sending object
task_id
ID of the current task
this
The current object

Error Functions: Handling errors

error
Get the error code, in a handler
error_arg
Get the error argument, in a handler
error_str
Get the error explanation, in a handler
rethrow
Continue propagating an error
throw
Throw an error in the calling method
traceback
Get the traceback, in a handler

Communication Functions: Communicating with the user

disconnect
Close connections to the current object
echo
Echo text to the current object
echo_file
Echo a file to the current object

Object Functions: Operations on the current object

add_parameter
Add a parameter
ancestors
Get a list of ancestors
children
Get a list of children dbrefs
compile
Compile C-- code into a method
del_method
Remove a method
del_parameter
Remove a parameter
find_method
Find location of method definition
find_next_method
Find location of next method definition
get_var
Get value of a variable
list_method
Decompile method into C-- code
methods
Get a list of defined method names
parameters
Get a list of parameter names
parents
Get a list of parent dbrefs
set_var
Assign to a variable

Administrative Functions: Privileged operations

binary_dump
Bring binary database up to date
bind
Begin listening on a port
chparents
Change parents of an object
conn_assign
Set the current connection's object
connect
Connect to a remote server
create
Create an object
data
Getting the data on an object
destroy
Destroy an object
log
Write a string to stderr
run_script
Execute an administrative script
set_heartbeat_freq
Set the heartbeat frequency
shutdown
Shut down the server
text_dump
Dump a text database image
unbind
Stop listening on a port

Miscellaneous Functions: Miscellaneous operations

abs
Take the absolute value of a number
ctime
Convert the time to string format
max
Find the maximum of several values
min
Find the minimum of several values
random
Get a random number
run_script
Execute an administrative script
time
Get the current time
version
Get the server version number

Administration: Running and maintaining the server

Starting
Starting up the server
Disk Database
Managing the disk database
Connections
How Coldmud manages network connections