length

 

 

Overview

The length function returns the number of elements in a Vector.

String

The length function returns the number of characters in a String or Text argument.

Symbol

The length function takes a Symbol argument and returns the number of characters in the global value of a Symbol .

Structure

The length function returns the number of bindings in the Structure.

Dictionary

The length function returns the number of bindings in the Dictionary.

Directory

The length function returns the number of bindings in the Directory.

Brick

The length function returns the number of rows in a Brick.

Matrix

The length function returns the number of elements in a Matrix.

NumMatrix

The length function returns the number of elements in a NumMatrix.

Pair

The length function returns the number of elements in a Pair.

List

The length function returns the number of elements in a List.

ObjectRepository

The length function returns the number of objects currently stored in the specified Object Repository database archive file {aGor}.

Usage

The length function should be used when you need to determine the number of elements in a Structure, Dictionary, Directory, Matrix, Vector, Pair or List. This type of counting is called a shallow count in which embedded collection objects are counted as one. An alternate function, the count function, performs a deep count, which is used to determine the total number of items in an object, including the items in embedded collection objects.

String

The length function should be used when you need to determine the number of characters in a Text or String.

Symbol

The length function should be used when you need to determine the number of characters in a Symbol's global value.

Brick

The length function should be used when you need to determine the number of fields in a Brick.

ObjectRepository

The length function is used to query the Object Repository for the number of objects in the Object Repository. If the physical size of the Object Repository is the information needed, see the sizeof function.

 

Syntax


Expression:

(length vector)


Arguments Name Type Description
Argument:vectorVector FltVector IntVector ShortVector NumVector ObjVector BitVector PcodeVector The Vector which you want to determine the length.

Returns:

Returns the number of bindings in the Vector.




Expression:

(length string)


Arguments Name Type Description
Argument:string Text or String The Text or String that needs to be measured

Returns:

Returns the number of characters in the Text or String




Expression:

(length symbol)


Arguments Name Type Description
Argument:symbolSymbol The Symbol that needs to be measured

Returns:

Returns the number of characters in the Symbol's global value




Expression:

(length struct)


Arguments Name Type Description
Argument:structStructure The structure which you want to determine the length.

Returns:

Returns the number of bindings in the Structure.




Expression:

(length dictionary)


Arguments Name Type Description
Argument:dictionaryDictionary The Dictionary which you want to determine the length.

Returns:

Returns the number of bindings in the Dictionary.




Expression:

(length directory)


Arguments Name Type Description
Argument:directoryDirectory The Directory which you want to determine the length.

Returns:

Returns the number of bindings in the Directory.




Expression:

(length Brick)


Arguments Name Type Description
Argument:BrickBrick The Brick which you want to determine the length.

Returns:

Returns the number of rows in the Brick.




Expression:

(length matrix)


Arguments Name Type Description
Argument:matrixMatrix The Matrix which you want to determine the length.

Returns:

Returns the number of values in the Matrix.




Expression:

(length nummatrix)


Arguments Name Type Description
Argument:nummatrixNumMatrix The NumMatrix which you want to determine the length.

Returns:

Returns the number of values in the NumMatrix.




Expression:

(length pair)


Arguments Name Type Description
Argument:pairPair The Pair that needs to be counted

Returns:

Returns the number of values in the input Pair.




Expression:

(length list)


Arguments Name Type Description
Argument:list List The List that needs to be counted

Returns:

Returns the number of values in the input List.




Expression:

(length aGor)


Arguments Name Type Description
Argument:aGorObjectRepository The ObjectRepository which will be tested.

Returns:

Returns the Number of objects in the Object Repository



 

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.

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

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 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 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 year

Analytic Information Server (AIS)

AIS Component Systems

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