symbolctl
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | symbolctl [2008/11/30 19:14] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | #$EPIC: symbolctl.txt, | ||
+ | ======Synopsis: | ||
+ | $__symbolctl__(TYPES) \\ | ||
+ | $__symbolctl__(PMATCH < | ||
+ | $__symbolctl__(CREATE < | ||
+ | $__symbolctl__(DELETE < | ||
+ | $__symbolctl__(DELETE < | ||
+ | $__symbolctl__(CHECK < | ||
+ | $__symbolctl__(GET < | ||
+ | $__symbolctl__(GET < | ||
+ | $__symbolctl__(GET < | ||
+ | $__symbolctl__(SET < | ||
+ | |||
+ | =====Description: | ||
+ | This function is a low-level interface to the unified symbol table. | ||
+ | For practical uses, read [[using symbolctl]]. | ||
+ | |||
+ | =====The TYPES operation===== | ||
+ | ====Usage: | ||
+ | $symbolctl(TYPES) | ||
+ | |||
+ | ====Synopsis: | ||
+ | The **TYPES** operation returns a list of types that are supported by | ||
+ | this function. | ||
+ | ^ Type ^ Description ^ | ||
+ | | ALIAS | Commands and functions you create with [[alias]] | | ||
+ | | ASSIGN | Variables you create with [[assign]], but not [[local]] | | ||
+ | | BUILTIN_COMMAND | Commands that are built in like [[msg]] or [[alias]] | | ||
+ | | BUILTIN_FUNCTION | Functions that are built in like [[word]] or [[symbolctl]]. | | ||
+ | | BUILTIN_EXPANDO | Variables that are built in like $E and $Z and $T | | ||
+ | | BUILTIN_VARIABLE | [[Set]]s that are built in like [[set high_bit_escape]] and [[set mail_interval]] | | ||
+ | |||
+ | More types may be supported in the future, so for forwards and backwards | ||
+ | compatability it is useful to check this to make sure you are operating on | ||
+ | a valid type. | ||
+ | |||
+ | ====Examples: | ||
+ | | ||
+ | returns | ||
+ | " | ||
+ | |||
+ | =====The PMATCH operation===== | ||
+ | ====Usage: | ||
+ | $symbolctl(PMATCH < | ||
+ | |||
+ | ====Synopsis: | ||
+ | Given a < | ||
+ | " | ||
+ | returns all of the symbols of that type that are matched by the pattern. | ||
+ | If no symbols match the pattern, then the empty string is returned. | ||
+ | |||
+ | This is very handy for doing command completion at the input line! | ||
+ | |||
+ | ====Examples: | ||
+ | | ||
+ | returns | ||
+ | " | ||
+ | |||
+ | =====The CREATE operation===== | ||
+ | ====Usage: | ||
+ | @ symbolctl(CREATE < | ||
+ | |||
+ | ====Synopsis: | ||
+ | Ensure that < | ||
+ | first created, they do not contain any actual values, but act as placeholders | ||
+ | in case you want to set values. | ||
+ | exists before you try to change any of its type values. | ||
+ | that already exists is harmless; feel free to do it. | ||
+ | |||
+ | ====Examples: | ||
+ | @ symbolctl(CREATE frobnitz) | ||
+ | @ symbolctl(SET frobnitz 1 BUILTIN_VARIABLE) | ||
+ | This creates a /set frobnitz as a boolean value with default value of OFF. | ||
+ | If you didn't do the CREATE first, then the SET would fail if " | ||
+ | did not exist in the symbol table. | ||
+ | |||
+ | =====The DELETE operation: | ||
+ | ====Usage: | ||
+ | @ symbolctl(DELETE < | ||
+ | @ symbolctl(DELETE < | ||
+ | |||
+ | ====Synopsis: | ||
+ | Delete all of the values of a particular symbol (first form) or just one | ||
+ | type (second form). | ||
+ | commands, and functions with this! There is no way to restore them back if | ||
+ | you make a mistake! | ||
+ | |||
+ | ====Examples: | ||
+ | @ symbolctl(DELETE booya ALIAS) | ||
+ | |||
+ | =====The CHECK operation===== | ||
+ | ====Usage: | ||
+ | @ symbolctl(CHECK < | ||
+ | |||
+ | ====Synopsis: | ||
+ | Inspects < | ||
+ | left for < | ||
+ | CREATE it again if you want to use it later. | ||
+ | Because empty symbols still take up space in the symbol table and still effect | ||
+ | lookup/ | ||
+ | |||
+ | ====== AN IMPORTANT NOTE ABOUT " | ||
+ | In order to " | ||
+ | If you try to " | ||
+ | will return the empty string to tell you that it failed. | ||
+ | use the CREATE operation above to bootstrap a new symbol before using it. | ||
+ | |||
+ | Now, /[[STACK]] PUSH and /[[STACK]] POP work by manipulating " | ||
+ | the symbol table. | ||
+ | value of a symbol. | ||
+ | will be copied to < | ||
+ | that original value moves to < | ||
+ | because the new < | ||
+ | |||
+ | So what you can do is use $symbolctl(GET < | ||
+ | many levels a symbol has, and then use $symbolctl(GET < | ||
+ | find out what types are available at that level so you can see if any of | ||
+ | them are interesting to you. IN THIS WAY you can directly manipulate the | ||
+ | [[stack]] push values without having to actually use the [[stack]] command. | ||
+ | |||
+ | In general, < | ||
+ | you are intentionally monkeying around with your /stack values. | ||
+ | |||
+ | ====== NOW BACK TO YOUR REGULARLY SCHEDULED HELP ====== | ||
+ | =====Getting information about the symbol table===== | ||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Return the number of levels of < | ||
+ | value is always 1 unless you have /STACK PUSHed something. | ||
+ | |||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Return all of the < | ||
+ | If < | ||
+ | it starts looking at the /STACK PUSHed values. | ||
+ | |||
+ | =====Getting information about ALIAS symbols===== | ||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Retrieve one of the values for one of your aliases | ||
+ | |||
+ | =====Getting information about ASSIGN symbols===== | ||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Retrieve one of the values for one of your assigns | ||
+ | |||
+ | =====Getting information about ASSIGN symbols===== | ||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Returns 0 if these types are not in use (ie, if there is not a | ||
+ | built in command), and returns non-zero if there is. If you' | ||
+ | smart, you won't try to do anything with the non-zero value. | ||
+ | |||
+ | =====Getting information about BUILTIN VARIABLE (/SET) symbols===== | ||
+ | ====Usage: | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | $symbolctl(GET < | ||
+ | ====Synopsis: | ||
+ | Retrieve information about a [[SET]]. | ||
+ | The " | ||
+ | Generally, either " | ||
+ | |||
+ | =====CHANGING information about ALIAS symbols===== | ||
+ | ====Usage: | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | ====Synopsis: | ||
+ | Change one of the values for one of your aliases. | ||
+ | the < | ||
+ | |||
+ | ====Usage: | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | ====Synopsis: | ||
+ | Change one of the values for one of your assigns. | ||
+ | the < | ||
+ | |||
+ | =====CREATING A NEW [[SET]] ===== | ||
+ | ====Usage: | ||
+ | @ symbolctl(SET < | ||
+ | ====Syopsis: | ||
+ | Create a new user-created /SET with default values (type == BOOL, | ||
+ | data == OFF, script is < | ||
+ | |||
+ | =====Changing the information about BUILTIN VARIABLE (/SET) symbols===== | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | @ symbolctl(SET < | ||
+ | ====Synopsis: | ||
+ | Change one of the values for one of your [[set]]' | ||
+ | change values for system [[set]]' | ||
+ | changes the DATA value to a default (< | ||
+ | everything else) so always set DATA after setting TYPE. | ||
+ | Yes, you can change the TYPE of a [[set]] after you create it! | ||
+ | It's probably a bad idea to set FLAGS for the present. | ||
+ | |||
+ | |||
symbolctl.txt · Last modified: 2008/11/30 19:14 by 127.0.0.1