Bookshelf Contents Previous Next Glossary Index Search

Scheme: Creating Symbols and Strings

In order to pass information around in Scheme, it is necessary to define symbols as placeholders for values, and strings as names for those values. This is done through two primitives, ui-symbol and ui-string. These functions add elements to symbol tables inside of Alias, unlike the define primitive which adds a symbol to Scheme's symbol table. In places where the name of a symbol is desired (e.g. the label for a menu item), a search is done of the string symbol table for a string with the same symbol name as the given symbol. If one is found, the associated string is used. If not, the actual symbol name is used instead. So, for example:

	(ui-symbol 'my_symbol 16)

The default value of the symbol will be 16. No ui-string is associated with this symbol. Therefore, the text "my_symbol" will appear whenever the name of this symbol is displayed.

Example 2:
	(ui-string 'my_symbol "Number of Cows")
	(ui-symbol 'my_symbol 16)

In this case a ui-string is defined with the same symbol name. When the name of the symbol "my_symbol" is required, a search is done for a ui-string with the same name. Here one is found, and the text "Number of Cows" will be used as the name of this symbol.



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.