Context Variables

 

_Blackboard

Overview

The _Blackboard variable is assigned, by the user, the current Analytic Information Server ObjectRepository for the publishing of Lambda knowledge structures and opinions. The _Blackboard is the conventional location for publishing Lambda knowledge structures and opinions.

 

Type: Variable

 

When To Use

The use of the _Blackboard variable is a convention. The _Blackboard variable usually contains the Lambda repository where Lambda opinions are published.

 

Example1

(define _Blackboard (new ObjectRepository: "blackboard.db" clear:))

(setq _Blackboard[foo:] "foo says, I like ice cream.")

Publish an opinion in the blackboard.

_error

Overview

The _error Variable returns the error vector information saved by Analytic Information Server when the last error occurred. The error vector records the error information and the Lambdas that were active when the error occurred.

 

Type: Variable

 

 

When To Use

Use this variable when examining the error vector produced by an exception condition.

 

Example1

This example shows the error vector produced by an exception condition. Each element in the error vector contains the function name and displacement within the function at the time of the error.

(defun foo(n) (moo n))

(defun moo(n) (n 1 2))

(foo 3) Returns error: !Missing or Invalid Function Name!"

_error

The error vector contains #("!Missing or Invalid Function Name!" 3 #(foo 12) #(moo 8))

_FileCabinet

Overview

The _FileCabinet variable is assigned, by the user, the current Analytic Information Server ObjectRepository for the storing of Lambda scripts. The _FileCabinet is the conventional location for storing Lambda scripts and Lambda components.

 

Type: Variable

 

When To Use

The use of the _FileCabinet variable is a convention. The _FileCabinet variable usually contains the main Lambda repository for the server side application.

 

Example1

(define _FileCabinet (new ObjectRepository: "Lambda.db" clear:))

(setq _FileCabinet[foo:] "(defun foo(n) (* n n))")

 

Places an Lambda script in the new Lambda file cabinet.

_globals

Overview

The _globals Variable returns the Analytic Information Server global symbol table object. The global symbol table serves as the top level environment for Analytic Information Server.

 

Type: Variable

_MasterLambda

Overview

The _MasterLambda variable, by convention, is set by the user to the Master Lambda which supervises the current server side application.

By convention, the user defined File Cabinet (see _FileCabinet) contains all of the components necessary to build a Master Lambda and to set into operation a user defined server side application. The supervisor of every server side application is its Master Lambda. Some Analytic Information Server host shell programs contain a Console menu item called "MasterLambda(Ma)" just to allow easy invocation of the Master Lambda in the current user analytic model.

 

Type: Variable

_parser

Overview

The _parser variable returns the current Lambda Information Server parser function which is to be used by the client prior to compilation. See the lisp, basic, morph, and compile functions for more information.

Changing the _parser variable causes the language syntax of the engine to change. After changing the _parser variable, the Analytic Information Server scripting language would be determined by the new system parser function.

Type: variable

_path

Overview

The global variable, _path, is reserved by the system to hold the directory and path name of the current working directory. The _path variable is set to the empty string "" at system startup. It is the programmer's responsibility to initialize the _path variable. When the _path variable is referenced, the text contents of the _path variable are automatically attached to the beginning of database archive file named in the new function. The contents of the _path variable are also automatically prepended to the file names in both the new ObjectRepository: function and the fileOpen function.

 

 

Type: Variable

 

When To Use

The _path is a global variable used to hold a path name string assigned by the programmer. If the _path variable is something other than a null string, the _path variable string will be prepended to the filename specified in the new function.

Example1

(setq _path "")

(setq gor (new ObjectRepository: "myarchive.odb"))

The database archive file name is now "myarchive.odb"

 

Example2

(setq _path "d:\\test\\")

(setq gor (new ObjectRepository: "myarchive.odb"))

The database archive file name is now "d:\test\myarchive.odb"

_saveTypes

Overview

The _saveTypes is a global variable that contains a Boolean value. The contents of the _saveTypes variable determine the calculation of the object closure when objects are saved to an Object Repository, a file, or a vector. At system startup, the _saveTypes variable is initialized to False. If the _saveTypes variable is later set to True, global value and type information are to be saved along with symbol objects.

 

Type: Variable

 

 

When To Use

Lambda Information Server Symbols have the two properties associated with them: type property and global value property. Typically, the preservation of type and global value information is needed when a Symbol is being used as a container. However, Symbols, are themselves data and may not be associated with a type or value. In the latter case, the type and global value properties are not important. The _saveTypes variable allows the programmer to control whether type and global information should be saved along with a Symbol object when the object is saved in an Object Repository, or file or vector.

Example1

(defineStructure x: Old1:) ;; Global type info linked to x

(setq x #(1 2 3)) ;; Global value stored in x

(setq y x:) ;; y contains the Symbol x:

(setq db (new ObjectRepository: "test.db"))

(setq _saveTypes false) ;; Do NOT save Symbol global and type info

(setq db[0] y) ;; Save record data only

(setq x #void) ;; Destroy global value in x

(defineStructure x: New1: ) ;; Destroy global type info in x

(setq y db[0]) ;; Read previously saved record into y

(writeln "y = " y ", x = " x ", fieldsof (x) = " (fieldsOf x: ) )

 

The result output from the writeln statement is:

y = x, x = #void, fieldsof (x) = #{New1: #void}

Note that the contents of the Symbol x: is #void.

Note that the type information of the Symbol x: is different from the original defineStructure statement.

Example2

(defineStructure x: Old1:) ;; Global type info linked to x

(setq x #(1 2 3)) ;; Global value stored in x

(setq y x:) ;; y contains the Symbol x:

(setq db (new ObjectRepository: "test.db"))

(setq _saveTypes true) ;; DO save Symbol global and type info

(setq db[0] y) ;; Save Symbol global and type info

(setq x #void) ;; Destroy global value in x

(defineStructure x: New1: ) ;; Destroy global type info in x

(setq y db[0]) ;; Read previously saved record into y

(writeln "y = " y ", x = " x ", fieldsOf (x) = " (fieldsOf x: ) )

 

The result output from the writeln statement is:

y = x, x = #void, fieldsOf (x) = #{New1: #void}

 

Note that the contents of the Symbol x: is the Vector #(1 2 3)

Note that the type information of the Symbol x: is the same as the original defineStructure statement.

 

_schema

Overview

The _schema variable returns the current top level schema Lambdas. The current database schema is specific to each server side database application, and is assigned by the database administrator's startup script at the start of each application. By convention, the _schema variable contains a Vector of Lambdas. The client examines the Interfaces data for each schema Lambda (see the Lambda's In property) to determine how the interact with the database.

Type: variable

_Startup

Overview

The _StartUp Variable, by convention is set by the user. The _Startup Variable should contain the initialization Lambda which loads the current analytic model and the Master Lambda into the Workspace.

Every user defined file cabinet contains all of the components necessary to build a Master Lambda and to set into operation a user defined analytic model. The supervisor of every user defined analytic model is its Master Lambda. Some Analytic Information Server host shell programs contain a Console menu item called "MasterLambda(Ma)" just to allow easy invocation of the Master Lambda in the current user analytic model.

 

Type: Variable

_sysError

Overview

The _sysError Variable returns the engine system error when a system error occurs. The _sysError code, if present, must be a number.

 

Type: Variable

 

 

When To Use

The _sysError variable is used when we want to know what system error occurred.

 

Example1

 

The valid system error codes are as follows:

 

Out of memory 1001

Garbage frame overflow 1002

Damaged memory handle 1003

Lisp stack overflow 1004

User requested escape 1005

Invalid pcode encountered 1006

Damaged object discovered 1007

Lisp recursion limit exceeded 1008

Garbage frame release failure 1009

Lisp stack release failure 1010

Lisp resursion imbalance 1011

User requested quit 1012

Wrong file or database version 1013