(1) change_name a bElementsThe simplest type of element is a string of characters not containing any spaces or other characters reserved by the command language. The semicolon and new line characters are reserved. Other reserved characters will be identified as they are encountered. The three elements in example 1. at the end of the previous section are the simple character strings "change_name", "a", and "b".Any element (or part of an element) may be a command. The user can tell the interpreter to evaluate an element as a command by surrounding the element with brackets (which are reserved characters). For example in
(2) change_name [oldestfile] bthe second element is a command. When an element is evaluated is a command, the result of that evaluation (i.e., the returned value of the function) replaces the original element. Suppose that the command "oldestfile" returns as its value the name of the oldest file in the users' directory, then example 2 changes the name of the oldest file to "b". In this case, the first argument to the command program change name is the character string returned by the command program "oldestfile" and the second argument is the character string "b".Note that the spaces before and after the brackets are necessary to indicate that the result of "oldestfile" is an element and not a portion of an element. Suppose that the user had a program "me" which returned as its value his default working directory, (e,g., "me" would return a character string of the form ">user_dir_dlr>Southworth.MAC").Other features are more than we have in Tcl, and interesting to look at: "More than one iteration set may appear in a command. All possible combinations will be executed. For instance, the compound command
(print delete) xyz(.epl .eplbsa);would expand into the commands:
print xyz.epl print xyz.eplbsa delete xyz.epl delete xyz.eplbsaThe Multics command language introduced the -option syntax for separating option names from option values. (In Multics jargon, these were called control arguments.) Control arguments often had both long and short names, like -home_dir and -hd (think -foreground and -fg).Because the language did not use {} to quote text, text that contained quotation marks had to use quote doubling. So a command to the abbrev processor to define a command name check might look like this:
.ab check do "if [[compare &1 &2]] -then ""delete &2"" -else ""fo check; cpa &1 &2; ro; dp -dl check"""This means (to parse this)
- .ab - command for the abbrev processor to define
- check - the name of the command to define
- do - taking the quoted string that immediately follows, substitute parameters that follow into the positions as indicated, i.e., parameter 1 is substituted where &1 appears, etc.
- if - test a condition and then perform one of two actions
- compare - compare of two seqments for equality and return a boolean result
- -then - the command(s) to execute on a "true" comparison
- delete - delete the segment indicated
- -else - the command(s) to execute on a "false" comparison
- fo check - send output normally sent to standard_output to the file named "check"
- cpa - do a compare_ascii of the two segments (think Unix diff)
- ro - revert_output from "check" back to the console
- dp - daemon print' the file named "check", deleting it when done.
escargo 11 Apr 2005 - This synopsis does not mention how commands can be combined. Multics had both commands and active functions, which return results when run.Active functions were surrounded by square brackets when invoked. - RS: Isn't it clearly enough stated (pasted) that "The user can tell the interpreter to evaluate an element as a command by surrounding the element with brackets (which are reserved characters)" ? :)escargo 13 Apr 2005 - I had wanted to give a more complete example (like maybe Towers of Hanoi), but I didn't have the time. One significant difference between Tcl and Multics active functions is that the returned text is rescanned to look for more active function invocations. There is some magic defined somewhere to tell the command processor that the current invocation is a passive function and should not be rescanned. This makes Multics active functions more like macro processing in some macro languages.Dave Griffin 15 Apr 2005 - The Multics pages state that their active functions came from TRAC, which RS has explored herein.escargo 18 Apr 2005 - No denying it, but the Multics command language had both square brackets and a handling of unknown functions that TRAC did not have.escargo 3 Apr 2008 - Multics software has apparently been released under and open source license: http://www.opensource.org/licenses/multics.txt