Example ShortVector map 007

 

 

Description

This example defines a ShortVector and applies the add1 function to each element of the ShortVector using the map function.

 

Details

A Short Vector is defined.

(define Scores #(short| 89 90 91 ) ) Returns: #<ShortVector 123456>

Increments the values by one.

(setq NewScores (map add1 Scores)) Returns: #<ShortVector 123456>

Displays the resulting Vector.

NewScores[0] Returns: 90
NewScores[1] Returns: 91
NewScores[2] Returns: 92

 

Related Examples

Here are examples of the map function at work.

Dictionary map 002 Directory map 003 FltVector map 005 IntVector map 006
Matrix map 006 Matrix map 007 NumMatrix map 010 NumVector map 007
Pair map 008 ShortVector map 007 Structure map 001 Vector map 004

 

Function Links

Here is the link to the current function used in this example.

map

Here are a number of links to other related functions.

mapc(#void) new(#void)

 

Argument Types

Here are the links to the data types of the arguments used in this example.

ShortVector

Here are a number of links to examples having similar argument types.

ShortVector addMethod 021 ShortVector append 008 ShortVector apply 007 ShortVector binaryInsert 006
ShortVector binarySearch 007 ShortVector cdr 008 ShortVector compare 016 ShortVector compareEQ 015
ShortVector compareGE 015 ShortVector compareGT 015 ShortVector compareLE 015 ShortVector compareLT 015
ShortVector compareNE 015 ShortVector comparison functions 015 ShortVector copy 008 ShortVector defmethod 019
ShortVector delete 011 ShortVector insert 007 ShortVector inside 006 ShortVector isAtom 007
ShortVector isEqual 015 ShortVector isIdentical 014 ShortVector isObject 009 ShortVector length 010
ShortVector map 007 ShortVector mapc 007 ShortVector member 006 ShortVector methodsOf 019
ShortVector new 011 ShortVector ref 024 ShortVector remove 006 ShortVector resize 008
ShortVector reverse 005 ShortVector send 017 ShortVector setCdr 008 ShortVector setq 021
ShortVector sizeof 016 ShortVector sort 015 ShortVector type 018 ShortVector uniqueInsert 007
ShortVector vectorFill 005

Analytic Information Server (AIS)

AIS Component Systems

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