Skip to content

Commit dcfb087

Browse files
committed
Made changes in stdlib_hashmaps.md suggested by Ian Gaestrus Pauli and Ivan Pi
Changed names of arguments to copy_key from key_in and key_out to old_key and new_key. Added note to set_key definition to show how values ofther than scalar default characters and int8 vectors can be used as keys. Chaanged hassher_pointer to hasher_pointer. [ticket: X]
1 parent 9c812d8 commit dcfb087

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

doc/specs/stdlib_hashmaps.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ opaque. Their current representations are as follows
136136
end type other_type
137137
```
138138

139-
The module also defines six procedures for those types: `copy_key`,
139+
The module also defines six procedures for those types: `copy_key`,
140140
`copy_other`, `equal_keys`, `free_key`, `free_other`, `get`, and
141141
`set`, and one operator, `==`,
142142
for use by the hash maps to manipulate or inquire of components of
@@ -210,18 +210,18 @@ Returns a copy of an input of type `key_type`.
210210

211211
##### Syntax
212212

213-
`call [[stdlib_hashmap_wrappers:copy_key]]( key_in, key_out )`
213+
`call [[stdlib_hashmap_wrappers:copy_key]]( old_key, new_key )`
214214

215215
##### Class
216216

217217
Subroutine.
218218

219219
##### Arguments
220220

221-
`key_in`: shall be a scalar expression of type `key_type`. It
221+
`old_key`: shall be a scalar expression of type `key_type`. It
222222
is an `intent(in)` argument.
223223

224-
`key_out`: shall be a scalar variable of type `key_type`. It
224+
`new_key`: shall be a scalar variable of type `key_type`. It
225225
is an `intent(out)` argument.
226226

227227
##### Example
@@ -233,11 +233,11 @@ is an `intent(out)` argument.
233233
use iso_fortran_env, only: int8
234234
implicit none
235235
integer(int8) :: i, value(15)
236-
type(key_type) :: key_in, key_out
236+
type(key_type) :: old_key, new_key
237237
value = [(i, i = 1, 15)]
238238
call set( key_in, value )
239-
call copy_key( key_in, key_out )
240-
print *, "key_in == key_out = ", key_in == key_out
239+
call copy_key( old_key, new_key )
240+
print *, "old_key == new_key = ", old_key == new_key
241241
end program demo_copy_key
242242
```
243243

@@ -637,7 +637,7 @@ pointers intended for use as a hash function for the hash maps.
637637
hasher_pointer => fnv_1a_hasher
638638
array1 = [ 5_int8, 4_int8, 3_int8, 1_int8, 10_int8, 4_int8 ]
639639
call set( key, array1 )
640-
hash = hassher_pointer(key)
640+
hash = hasher_pointer(key)
641641
print *, hash
642642
end program demo_hasher_fun
643643
```
@@ -913,10 +913,16 @@ is an `intent(out)` argument.
913913
is an `intent(out)` argument.
914914

915915
`value`: if the first argument is `key` `value` shall be a default
916-
character string expression, or a vector expression of type integer
916+
character string scalar expression, or a vector expression of type integer
917917
and kind `int8`, while for a first argument of type `other` `value`
918918
shall be of type `class(*)`. It is an `intent(in)` argument.
919919

920+
##### Note
921+
922+
Values of types other than a scalar default character or an
923+
`INT8` vector can be used as the basis of a `key` by transferring the
924+
value to an `INT8` vector.
925+
920926
##### Example
921927

922928
```fortran

0 commit comments

Comments
 (0)