Core Help Root: Subsystems: Messages: @def-msg


Syntax: `@def-msg|@undef-msg <target>:<msg> [options]`

This command is used to define and undefine a message base. Because multiple branches for one base can exist, you cannot define the default values for the message with this command, use @msg for this instead, after the message is defined. More information on Messages can be found in the section Messages. Options can be:

+b?ranches Define the branches, in a comma delimited list.
+c?ompiler Define the compiler. Defaults to $compiler.
+e?valuator Define the evaluator. Defaults to $bs_eval.
+g?etter Define the getter. Defaults to 'standard_get_msg

An example of defining the message "open" with the branches "actor" and "general":

@def-msg mybox:open +b=general,actor
@msg mybox:open = General Message
@msg mybox:open.actor = Actor's Message

You can also specify a two-part branch, with the final part being variable. What this means is the third part of the message name can be variable, and when the message is evaluated the appropriate branch will be used--if it exists. For instance, the message "invoke" on $path has the branch "source" which is variable--meaning you add a third part to it. In this example the third part is a way for the path--i.e. one of its sources or destinations. So a possible message set for this would look like:

invoke.source = [actor] goes through [this].
invoke.source.courtyard = [actor] leaves the courtyard.

In this example, the default 'source' is used for all messages unless the source is the courtyard, when the second message is used instead.

Variable messages are specified when defining the branches--in one of two wa ys. Either an asterisk character is placed where the variable portion should be, or a unique token specified in parenthesis is placed there, such as:

invoke.actor.($source)

If no token is specified, then a dollar sign followed by the branch name is used instead. When evaluating the message the interpreter will look for a ctext variable by that name. If it exists, it will build a branch using the objname of the value of that variable, such as:

source.place_621

If this branch is defined, then it will use it instead of the default branch.


@def-msg | ColdC Interface | @msg | Message Propagation


the Cold Dark