create. Creating an empty hash or copying existing hash

^hash::create[existing hash
 or hashfile or user-defined object or file]

existing hash or hash compatible object is not specified, an empty hash will be created. Otherwise, the constructor will make a copy of it.

An empty hash is needed when we are going to dynamically fill it with data, e.g.:


Before performing loop
for, we have defined what exactly we are going to fill with data.

If we are planning to change a hash's content intensively, but still want to preserve initial values, we had better create a copy of the hash. In this case, only the hash's copy will be changed, while initial values will remain intact. For example:


Note: field
_default is also copied. [3.1.4]

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 25.04.2017