Use the saveObject function to serialize objects or immediate data types for storage into a bytevector, external buffer or file. Also use the function to return just the size of the serialized data. The serialized data consists of a record header followed by the uncompressed serialzed representation an object and all of the objects it depends on. This object serialization is called an Object Closure and together with the record header is the Object Closure Record. Immediate data types can also be serialized, along with the obligatory record header. Immediate data serialized in this way is also called an Object Closure Record.

Use the loadObject function to instantiate the contents of an Object Closure into memory.

The saveObject takes a variety of argument signatures. Use caution when constructing an expression involving saveObject to ensure you get the behavior you desire. This function has the following forms:

(saveObject fileID target true) and (saveObject fileId target)- Use these form to save the target, as an object closure record inot the open binary file specified by fileID. The object closure record will be written at the current position in the specified file.

(saveObject #void target false) - Use this form to get the size of an object closure record size. The "target" argument can be of immediate or object type.

(saveObject target) - Use this form to return a bytevector containing the object closure record. The "target" argument can be of immemdiate or object type.

(saveObject target buflen bufptr) - Use this form to write an object closure record into a buffer. The buflen argument is the length of the target buffer an should be the exact result of a (sizeof target) call. The bufptr argument should of type POINTER and should point to the beginning of the buffer. Use this form of the saveObject function to pass object closure records to external applications or internal C/C++ code.


The saveObject function is used to generate a serialization of an immediate or object type along with a record header to create a Object Closure Record. These records can be returned as a bytevector, saved to an open file or written into a external buffer. Use the saveObject function with the loadObject function to save and load any type of data in the AIS system.




(saveObject fileID target saveFlag )

(saveObject fileID target)

(saveObject target)

(saveObject target bufferLen bufferPtr)

Arguments Name Type Description
Argument:targetCharacter String Symbol Vector BitVector ByteVector IntVector Void FltVector ObjVector Structure Dictionary Directory Brick Pair List Matrix NumMatrix Integer Float Number Complex Boolean Date Function Any value of immediate or object type.
Argument:fileIDInteger Optional argument. If present, must be an Integer representing the fileID of the file previously opened by fileOpen. The file must be a binary file.
Argument:saveFlagBoolean Optional argument. If present, and if equal to false, the saveObject will compute and return only the size of the Object Closure Record.


(saveObject fileId target false) -- returns sizeof object closure record. This is the same as the result returned from a (sizeof target) call.

(saveObject fileId target) or (saveObject fileId true) -- returns size of object closure record written to file.

(saveObject target) -- returns a bytevector containing object closure record.

(saveObject target bufferLen bufferPtr) -- returns size of object closure record written into specified buffer.



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.

Character String Symbol Vector
BitVector ByteVector IntVector Void
FltVector ObjVector Structure Dictionary
Directory Brick Pair List
Matrix NumMatrix Integer Float
Number Complex Boolean Date

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

++ += + /=
/ *= * --
-= - abortTransaction abs
acos add1 addMethod addi
appendWriteln append apply argument
arithmetic asin associate atan
avg badd balance bcompareEQ
bcompareGE bcompareGT bcompareLE bcompareLT
bcompareNE bdiv beginTransaction binaryInsert
binaryNand binaryNor binaryNot binaryNxor
binarySearch bitToIntegerVector bitToNumberVector bitwiseAnd
bitwiseNand bitwiseNor bitwiseNot bitwiseNxor
bitwiseOr bitwiseShiftLeft bitwiseShiftRight bitwiseXor
bmod bmul boolean c::r
cadd callcc car ccompareEQ
ccompareGE ccompareGT ccompareLE ccompareLT
ccompareNE cdiv cdr char
character checkPointTransaction class clean
clear closeLog cmod cmul
code commitTransaction compareEQ compareGE
compareGT compareLE compareLT compareNE
compare comparison compile complex
compress conjugate cons copy
cos cosh count csub
date day days360 debugBrowsableProcs
debugDetective debugEval debug decode
defchild defclass define(macro) defineStructure
define defmacro defmethod deforphan
defriend defstruct defun deg
deleteRows delete dimension disassemble
display divi downcase encode
evalInSyncLocalContext eval exit exp
exportCsv exportSbf exportTab expt
fact fdisplay fieldsOf fileClose
fileCopy fileDir fileDisplay fileEraseDir
fileErase fileExists fileMakeDir fileOpen
fileReadAll fileReadRecord fileRead fileResize
fileSeek fileSizeOf fileWriteAll fileWrite
filewriteln findBlock find floor
fraction freeBlock gc gcd
getGlobalValue getRecursionCount getSymbolTable getTickCount
globalBinding hashString hour iadd
icompareEQ icompareGE icompareGT icompareLE
icompareLT icompareNE idiv imaginary
imod importCsv importSbf importTab
imul insertRows insert inside
inspect integer isAtom isBitVector
isBoolean isBound isByteVector isCharAlphabetic
isCharAlphanumeric isCharLowercase isCharName isCharNumeric
isCharUppercase isCharWhitespace isChar isCharacter
isClass isComplex isDate isDictionary
isDirectory isEqual isError isEven
isExact isFloatVector isIdentical isImmediate
isInexact isInside isIntegerVector isInteger
isLambda isMatrix isMember isMoney
isNegative isNull isNumberMatrix isNumberVector
isNumber isObjectVector isObject isOdd
isPair isPcodeVector isPositive isString
isStructure isSymbol isText isTransaction
isType isVector isZero isub
julian kurtosis last lcm
left length lisp list
loadModule loadObject loadRepository loadWorkspace
lock log10 log2 logConsole
log logbase macroReplace makeDictionary
makeGaussianMatrix makeGramMatrix makeQuotedList makeQuotedSymbol
makeStructure map mapc matrixGaussianEliminate
matrixGaussianSubstitute max median member
methodsOf mid min minute
mod modi money month
morph muli nadd ncompareEQ
ncompareGE ncompareGT ncompareLE ncompareLT
ncompareNE ndiv new nmod
nmul now nsub number
objectToDictionary objectToDirectory objectToList objectToMatrix
objectToNumMatrix objectToNumVector objectToStructure objectToVector
offset onError openLog pair
parent parse pi pointer
preAllocateFixedMemoryBlocks product proplist proprecord
putprop qt quit quote
rad random randomize range
rank real refAttributes refValues
ref remProp remove rename
replace rept reset resize
reverse right round run
saveImmediate saveModule saveObject saveRepository
saveWorkspace second send setAttributes
setBlock setCar setCdr setLastCdr
set setf setq sigmoid
sign sin sinh sizeof
skew sleep sort sql
sqrt srandom stdev stdevp
stringCiEQ stringCiGE stringCiGT stringCiLE
stringCiLT stringCiNE stringFill stringToBVector
stringToVector string sub1 subi
submit substitute substringCiEQ substringCiGE
substringCiGT substringCiLE substringCiLT substringCiNE
substringEQ substringFill substringGE substringGT
substringLE substringLT substringNE substring
sum sumsqr super svmRegression
symbolToTypeCode symbol systemCheck system
tan tanh text time
today trim type uncompress
uniqueInsert unlock upcase var
varp vectorBinaryInnerProduct vectorBipolarInnerProduct vectorCosineInnerProduct
vectorCubeInnerProduct vectorDelete vectorExpInnerProduct vectorFill
vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct vectorQuintInnerProduct
vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct vectorTanInnerProduct
vectorTanhInnerProduct version writelg writeln

Analytic Information Server (AIS)

AIS Component Systems

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