Delimiter

From TinyMUX
Jump to navigation Jump to search

A delimiter is a meta character or series of characters which separate elements of data into a list. Some care may needed to insure that the characters used to delimit lists do not inadvertantly appear in any element. Many functions and commands are capable of operating on lists.

In English, for example, the most common delimiter is a space. In the list "1,2,3,4,5" the delimiter is a comma.

The typical convention in TinyMUX coding is to use the "|" (pipe) character as a delimiter.

Delimiters may be nested in order to work on data lists in "chunks." For example:

Bob Smith:555-1212:427 Solomon Way|Alice Jones:555-7612:15 North Main Street|John Schultz:555-8819:725 Elm Street

Server Differences

TinyMUSH 3.1 and TinyMUX 2.4 support multi-character delimiters. That is, 'iter(1--2--3,##,--,==)' becomes '1==2==3'. PennMUSH and RhostMUSH support single-character delimiters. That is, 'iter(1-2-3,##,-,=)' becomes '1-2-3'.

TinyMUSH and TinyMUX use the @@ notation for indicating that the output delimiter is empty or NULL. That is, 'iter(1-2-3,##,-,@@)' becomes '123'. Whereas, on PennMUSH and RhostMUSH, an empty output delimiter accomplishes the same thing. That is, 'iter(1-2-3,##,-,)' becomes '123'.