Symbol
|
At least within the United States, Lisp has become the defacto language of choice for symbolic processing. Of course, the Symbol object plays a central role in symbolic processing. Essentially a Symbol object is a string, but a string with certain important properties.
The most difficult aspect of Symbol objects is their simplest aspect. Symbols are things in and of themselves (each Symbol has a system-wide unique text value). In the global context, a Symbol also has a global variable value. In the local context, a Symbol may have a local variable value different from its global variable value. Whether a Symbol object refers to itself, its global, or its local variable contents is controlled, in Lisp, with quoting.
The Symbol object is used in any situation that a named identifier is need to hold global or local values. In other words, Symbols are used to label a container. Furthermore, since Symbol objects are unique, Symbols should be used instead of Strings where storage is to be minimized.
A quoted symbol always refers to itself. In this sense, it acts as a kind of unique String object. The following simple example may be helpful.
(setq xyz 20) ;; Set the global value of the Symbol |xyz| (no colon or quote).
xyz:[0] => #\x ;; Return the 1st character in the text value of the |xyz| Symbol
xyz:[1] => #\y ;; Return the 2nd character in the text value of the |xyz| Symbol
xyz:[2] => #\z ;; Return the 3rd character in the text value of the |xyz| Symbol
(setq xyz 'abc) ;; Set the global value of the Symbol |xyz| to the Symbol |abc|.
(setq xyz abc:) ;; Set the global value of the Symbol |xyz| to the Symbol |abc|.
Note: In Lisp the colon (trailing) and the quote (leading) have the same meaning when used with a Symbol.
An unquoted symbol always refers to the local or global variable value of the Symbol (depending upon the context). In this sense, it is used to name containers (variables) which may hold values during program operation. The following simple example may be helpful.
(setq xyz 20) ;; Set the global value of the xyz variable (no colon or quote).
xyz ;; Return the global value of the xyz variable 20
(setq xyz 'abc) ;; Set the global value of the Symbol |xyz| to the Symbol |abc|.
(setq xyz abc:) ;; Set the global value of the Symbol |xyz| to the Symbol |abc|.
Note: In Lisp the colon (trailing) and the quote (leading) have the same meaning when used with a Symbol.
xyz[0] => #\a ;; Return the 1st character of the value held in the xyz variable
xyz[1] => #\b ;; Return the 2nd character of the value held in the xyz variable
xyz[2] => #\c ;; Return the 3rd character of the value held in the xyz variable
Note: In Lisp, local and global variables are determined by context, as follows.
(setq xyz 20) ;; Set the global value of the xyz variable (no colon or quote).
xyz ;; Return 20, the global value of the xyz variable
(defun foo()
vars: ( xyz ) ;; Define the local xyz variable (different from the global ;; variable)
(setq xyz 30) ;; Set the local value of the xyz variable (no colon or quote).
xyz ;; Return the local value of the xyz variable
) ;; end of foo function
(setq abc (foo)) ; The global variable abc is set to 30
xyz ; Returns 20, the global value of xyz
The BitVector is a Heap Object or an Object Data Type. The Analytic Information Server Object Types are stored in the Heap and are managed by the Heap manager. The Analytic Information Server Heap manager supports object resizing, garbage collection, and anti-fragmentation algorithms so that the user may concentrate on the analysis and modeling of data rather than on memory management. Without exception, all of the Object types are identified by an object id. The object id identifies a block of memory, managed by the Lambda Information Server memory manager, in which the Object's data is stored.
The Analytic Information Server Heap Object and Native Data types can be saved and loaded to and from persistent (disk file) storage at any time. Containers with immediate data are saved on disk in fixed length records equal to the size of the container. Containers with Heap object references are saved in fixed length records, which are automatically expanded to include the contents of the Heap object, and any objects referenced by the Heap object, etc. This feature is called Object Closure Management and is automatic with every Analytic Information Server container database save.
Analytic Information Server containers may be loaded from any database repository record at any time. If the data in the record is immediate, the database load fills the container with the immediate data. If the data in the record is an object closure, the database load fills the container with a Heap object reference, and all of the objects in the record are loaded back into the Heap with the same referential relationships they had when they were saved in the repository.
The Symbol object can be demonstrated by the following examples.