builtins::collections

Function hash_keys

Source
pub fn hash_keys(map: &VMHashMap) -> VMResult<Vec<Value>>
Expand description

Usage: (hash-keys hashmap)

Returns a vector of all the hashmaps keys. The keys will be unordered.

Section: hashmap

Example: (def tst-hash {:key1 “val one” ’key2 “val two” “key3” “val three” \S “val S”}) (test::assert-equal 4 (len (hash-keys tst-hash))) (test::assert-true (in? (hash-keys tst-hash) :key1) “ Test :key1“) (test::assert-true (in? (hash-keys tst-hash) ’key2) “ Test key2“) (test::assert-true (in? (hash-keys tst-hash) \S) “ Test S“) (test::assert-true (in? (hash-keys tst-hash) “key3”) “ Test key3“) (test::assert-false (in? (hash-keys tst-hash) :key4))