lock

 

 

Overview

The lock function prevents the contents of the specified symbol from being erased by the clear function.

Usage

The lock function is used to prevent the contents of the specified symbol from being erased by the clear function.

For instance the following Lisp code shows how to to preserve the contents of global variables from the clear function.

(defun foo(Number:X) (cos (sqrt x)))
(foo 4.0) ;; returns -0.4161468365471
(clear)
(foo 4.0) ;; returns an unknown function error
(defun foo(Number:X) (cos (sqrt x)))
(lock foo:)
(clear)
(foo 4.0) ;; returns -0.4161468365471
(defun moo(Number:X) (cos (sqrt x)))
(lock _globals) ;; lock all non-void global symbols
(clear)
(foo 4.0) ;; returns -0.4161468365471
true)

 

Syntax


Expression:

(lock name)


Arguments Name Type Description
Argument:nameSymbol The name is locked and its contents will not be destroyed by the clearfunction.

Returns: The return value is always ignored



Expression:

(lock _globals)


Arguments Name Type Description
Argument:_globalsSymbol The special argument _globals locks all global symbols currently holding non-void contents. No colon (:) follows the name _globals as is the case with other individual symbols.

Returns: The return value is always ignored


 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

Symbol

Here are also a number of links to functions having arguments with any of these data types.

++ += /= *=
-- -= addMethod append
apply binaryInsert binarySearch boolean
cdr character compareEQ compareGE
compareGT compareLE compareLT compareNE
compare comparison compress cons
count debug defchild defclass
define(macro) define defmacro defmethod
deforphan defriend defun delete
dimension disassemble display downcase
encode gc getGlobalValue getSymbolTable
globalBinding insert inside inspect
integer isAtom isBitVector isBoolean
isByteVector isCharAlphabetic isCharAlphanumeric isCharLowercase
isCharName isCharNumeric isCharUppercase isCharWhitespace
isChar isCharacter isComplex isDate
isDictionary isDirectory isEqual isError
isFloatVector isIdentical isInside isIntegerVector
isInteger isLambda isMatrix isMember
isMoney isNumberMatrix isNumberVector isNumber
isObjectVector isObject isPair isPcodeVector
isString isStructure isSymbol isText
isType isVector length list
lock macroReplace makeQuotedList makeQuotedSymbol
member methodsOf money new
number offset openLog pair
parent parse pointer proplist
proprecord putprop qt ref
remProp remove rename saveObject
saveRepository setCar setCdr setLastCdr
set setf setq sizeof
sql string svmRegression symbolToTypeCode
symbol type uniqueInsert unlock
vectorFill writelg writeln

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE