hash-sets: fix help-lint warnings.
parent
895c6ca7c5
commit
931b5cc9bd
|
@ -2,7 +2,7 @@ USING: help.markup help.syntax math sequences ;
|
|||
IN: hash-sets
|
||||
|
||||
ARTICLE: "hash-sets" "Hash sets"
|
||||
"The " { $vocab-link "hash-sets" } " vocabulary implements hashtable-backed sets. Hash sets form a class:"
|
||||
"The " { $vocab-link "hash-sets" } " vocabulary implements hashtable-like sets. Hash sets form a class:"
|
||||
{ $subsections hash-set }
|
||||
"Constructing new hash sets:"
|
||||
{ $subsections <hash-set> >hash-set }
|
||||
|
@ -11,7 +11,7 @@ ARTICLE: "hash-sets" "Hash sets"
|
|||
ABOUT: "hash-sets"
|
||||
|
||||
HELP: hash-set
|
||||
{ $class-description "The class of hashtable-based sets. These implement the " { $link "sets" } "." } ;
|
||||
{ $class-description "The class of hashtable-like sets. These implement the " { $link "sets" } "." } ;
|
||||
|
||||
HELP: <hash-set>
|
||||
{ $values { "capacity" number } { "hash-set" hash-set } }
|
||||
|
|
|
@ -83,16 +83,16 @@ TUPLE: hash-set
|
|||
|
||||
PRIVATE>
|
||||
|
||||
: <hash-set> ( n -- hash )
|
||||
: <hash-set> ( capacity -- hash-set )
|
||||
hash-set new [ reset-hash ] keep ; inline
|
||||
|
||||
M: hash-set in? ( key hash -- ? )
|
||||
M: hash-set in?
|
||||
key@ 2nip ;
|
||||
|
||||
M: hash-set clear-set ( hash -- )
|
||||
M: hash-set clear-set
|
||||
[ init-hash ] [ array>> [ drop ((empty)) ] map! drop ] bi ;
|
||||
|
||||
M: hash-set delete ( key hash -- )
|
||||
M: hash-set delete
|
||||
[ nip ] [ key@ ] 2bi [
|
||||
[ ((tombstone)) ] 2dip set-nth-item
|
||||
hash-deleted+
|
||||
|
@ -100,13 +100,13 @@ M: hash-set delete ( key hash -- )
|
|||
3drop
|
||||
] if ;
|
||||
|
||||
M: hash-set cardinality ( hash -- n )
|
||||
M: hash-set cardinality
|
||||
[ count>> ] [ deleted>> ] bi - ; inline
|
||||
|
||||
: rehash ( hash -- )
|
||||
: rehash ( hash-set -- )
|
||||
[ members ] [ clear-set ] [ (rehash) ] tri ;
|
||||
|
||||
M: hash-set adjoin ( key hash -- )
|
||||
M: hash-set adjoin ( key hash-set -- )
|
||||
dup ?grow-hash (adjoin) ;
|
||||
|
||||
<PRIVATE
|
||||
|
|
Loading…
Reference in New Issue