{"size": 1649, "ext": "scrbl", "max_stars_repo_path": "doc/utils/hashtables.scrbl", "max_stars_repo_name": "christoff-buerger/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/utils/hashtables.scrbl", "max_issues_repo_name": "christoff-buerger/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/utils/hashtables.scrbl", "max_forks_repo_name": "christoff-buerger/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 35.847826087, "max_line_length": 78, "alphanum_fraction": 0.7537901759}
@; -*- coding: utf-8 -*-
@subsection[:tag "util.hashtables"]{(util hashtables) - Hashtable utilities}


@define[Library]{@name{(util hashtables)}}
@desc{This library provides extra utilities for hashtable operation.
}

@define[Function]{@name{hashtable-for-each} @args{proc hashtable}}
@define[Function]{@name{hashtable-map} @args{proc hashtable}}
@desc{@var{proc} must be a procedure which accepts 2 arguments.
@var{hashtable} must be a hashtable.

Iterates all keys and values in the given @var{hashtable} and passes them
to @var{proc} respectively.

The @code{hashtable-for-each} returns unspecified value. The 
@code{hashtable-map} returns a list of the @var{proc} result.

These procedures are analogous to @code{for-each} and @code{map} respectively.
}

@define[Function]{@name{hashtable-fold} @args{kons hashtable knil}}
@desc{@var{kons} must be a procedure which accepts 3 arguments.
@var{hashtable} must be a hashtable.

Iterates all keys and values in the given @var{hashtable} and passes them
and the result of @var{kons} to @var{kons} respectively. The first iteration
of the third argument is @var{knil}. The procedure returns the result of
all iterations.

Analogous to @code{fold}.
}

@define[Function]{@name{hashtable->alist} @args{hashtable}}
@desc{Converts to @var{hashtable} to an alist.}

@define[Function]{@name{alist->hashtable}
 @args{alist :key (compare eq?) (hasher symbol-hash)}}
@desc{Converts @var{alist} to hashtable.

The keyword arguments specify how to create the returning hashtable. By
default, it will use @code{make-eq-hashtable}. If it's specified then it
will use @code{make-hashtable} to create a hashtable.
}
