Fix help-lint errors for recent hashtable changes.
parent
32111a1095
commit
3b72b641e0
|
@ -96,7 +96,7 @@ HELP: histogram-by
|
||||||
{ $example "! Count the number of times letters and non-letters appear in a sequence."
|
{ $example "! Count the number of times letters and non-letters appear in a sequence."
|
||||||
"USING: prettyprint math.statistics unicode.categories ;"
|
"USING: prettyprint math.statistics unicode.categories ;"
|
||||||
"\"aaa123bc\" [ letter? ] histogram-by ."
|
"\"aaa123bc\" [ letter? ] histogram-by ."
|
||||||
"H{ { f 3 } { t 5 } }"
|
"H{ { t 5 } { f 3 } }"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ HELP: hash@
|
||||||
{ $description "Computes the index to begin searching from the hashcode of the key. Always outputs an even value since keys are stored at even indices of the underlying array." } ;
|
{ $description "Computes the index to begin searching from the hashcode of the key. Always outputs an even value since keys are stored at even indices of the underlying array." } ;
|
||||||
|
|
||||||
HELP: probe
|
HELP: probe
|
||||||
{ $values { "array" "the underlying array of a hashtable" } { "i" "a search index" } }
|
{ $values { "array" "the underlying array of a hashtable" } { "i" "a search index" } { "probe#" "an incrementing counter" } }
|
||||||
{ $description "Outputs the next hashtable search index." } ;
|
{ $description "Outputs the next hashtable search index." } ;
|
||||||
|
|
||||||
HELP: key@
|
HELP: key@
|
||||||
|
|
|
@ -17,7 +17,7 @@ TUPLE: hashtable
|
||||||
: hash@ ( key array -- i )
|
: hash@ ( key array -- i )
|
||||||
[ hashcode >fixnum dup fixnum+fast ] dip wrap ; inline
|
[ hashcode >fixnum dup fixnum+fast ] dip wrap ; inline
|
||||||
|
|
||||||
: probe ( array i probe# -- array i' probe# )
|
: probe ( array i probe# -- array i probe# )
|
||||||
2 fixnum+fast [ fixnum+fast over wrap ] keep ; inline
|
2 fixnum+fast [ fixnum+fast over wrap ] keep ; inline
|
||||||
|
|
||||||
: no-key ( key array -- array n ? ) nip f f ; inline
|
: no-key ( key array -- array n ? ) nip f f ; inline
|
||||||
|
|
Loading…
Reference in New Issue