Loading

CLONE

gts lists maps

The CLONE function does a shallow copy of a given Geo Time Series™, List, Map or Vector. Since 2.1.1 it can also clone Encoders.

As it makes a shallow copy, be careful when using CLONE on a List of Geo Time Series™ like those generated by the use of FETCH. Modifying a Geo Time Series™ in any of those list will alter the matching Geo Time Series™ in the other List. If you want to use CLONE after a FETCH, you will need to extract the Geo Time Series™ from the list, for example by using LIST->, GET or LMAP.

CLONE is available since version 1.0.0.

See also

Signatures

Examples

[ '60VgNqxhAaCdS6_uOLtZNMGWAbGpS5xmPL4gAbC_QbCjRbBiS5KhR5KmNMGpRaJQ.NV7RqKiRqxmHLF1B23L.0N.5k..KV.N6bF.0DxeA7x..3.pV.......4EyQb2_.CJnBnBnBnGN33V.' '60VgNqxhAaCdS6_uOLtZNMGWAbGpS5xmPL4gAbC_QbCjRbBiS5KhR5KmNMGpRaJQ.NV7RqKiRqxmHLF1B27L.0N.5k..KV.N6rF.0Dxe1Bju.3.ltaOaOaOa472Jp9g0F26BnBnBnBoL007.' ] UNWRAP // Decode a list of Geo Time Series™ 0 GET // Extract the first element of the list CLONE // Clone the extracted value NOW NaN NaN NaN 42 ADDVALUE // Add point to the cloned Geo Time Series™ [ 1 2 3 4 ] // Make a List CLONE // Clone the List 42 +! // Add 42 only to the cloned List
// Be careful, demonstrating shallow copy, you should usually not do that [ '60VgNqxhAaCdS6_uOLtZNMGWAbGpS5xmPL4gAbC_QbCjRbBiS5KhR5KmNMGpRaJQ.NV7RqKiRqxmHLF1B23L.0N.5k..KV.N6bF.0DxeA7x..3.pV.......4EyQb2_.CJnBnBnBnGN33V.' '60VgNqxhAaCdS6_uOLtZNMGWAbGpS5xmPL4gAbC_QbCjRbBiS5KhR5KmNMGpRaJQ.NV7RqKiRqxmHLF1B27L.0N.5k..KV.N6rF.0Dxe1Bju.3.ltaOaOaOa472Jp9g0F26BnBnBnBoL007.' ] UNWRAP CLONE // Adding values to the GTSs in the cloned List <% DROP NOW NaN NaN NaN 42 ADDVALUE // Add point to the cloned Geo Time Series™ %> LMAP // Now GTSs in both list are modified