versions

The versions operator shows array versions.

Synopsis

  • versions(named_array);

  • versions(vmax:true, ns: ns_name);

  • versions(vmax:true);

Summary

  • versions(named_array) lists all versions of a specific array.

  • versions(vmax:true, ns: ns_name) lists the maximum version of every array in namespace ns_name (or all for all namespaces).

  • versions(vmax:true) behaves the same as above, except that it takes the namespace from the current session.

Example

To create an array with two versions, do the following:

  1. Create an array containing one cell with the value 10:

    AFL% create array A <val:double>[i=1:1]; AFL% store(build(A, 10), A);


    The output is:

    {i} val {1} 10
  2. Change the values to 20:

    AFL% store(build(A, 20), A)


    The output is:

To get information about the versions of A, do the following:

  1. Use the versions operator to list the versions of array A:


    The output is:

  2. Use the versions operator to list the maximum version of all arrays in the namespace public

    The output is:

To examine the data of different versions:

  1. Use the scan operator and the @ array version specifier to access version 1

     

    The output is:

  2. Use the scan operator and the @ array version specifier to access version 2

     

    The output is: