hashtable?(3scm)

πŸ“¦ version 0-unstable-2024-02, in nixpkgs unstable

πŸ’– hashtable? β€” the vibe check for hashtables πŸ’–

okay bestie, this one's from the Scheme Programmer's Manual (yes, that's the 3scm manual section, it's giving very "reference docs but make it cute") ✨


🌸 NAME 🌸

hashtable? β€” the little procedure that checks if an object is a hashtable. that's it. that's the whole job. icon behavior honestly πŸ‘‘


πŸŽ€ LIBRARY πŸŽ€

she lives in two places, depending on your import vibe:

(import (rnrs))                     ;R6RS
(import (rnrs hashtables))          ;R6RS

both are R6RS, no cap πŸ’…


✨ SYNOPSIS ✨

(hashtable? obj)

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, you hand her an obj and she tells you the truth: #t if obj is a hashtable, #f otherwise. she's not out here guessing, she's not out here being shady β€” just a clean yes or no. lowkey the most honest friend you have 🫢


πŸ’œ RETURN VALUES πŸ’œ

returns a single boolean object. one. that's the whole return. #t or #f, nothing in between, no extra drama 🌈


πŸ“ EXAMPLES πŸ“

(hashtable? (make-eq-hashtable))  =>  #t
(hashtable? '())                  =>  #f

look at that first one slaying, and the second one?? '() is an empty list bestie, not a hashtable, she said #f and she meant it 😭


🧚 ERRORS 🧚

this procedure can raise exceptions with these condition types, so heads up:

  • &assertion (R6RS) β€” the wrong number of arguments was passed, or an argument was outside its domain. basically: don't do that. she will call you out πŸ’€

🌟 SEE ALSO 🌟

  • make-hashtable(3scm) β€” go make one first, then come back and vibe check it

πŸ‘‘ STANDARDS πŸ‘‘

R6RS, SRFI-126. both. she's certified, periodt πŸ’…


πŸ’« HISTORY πŸ’«

this procedure is new in R6RS. and fun fact for the lore girlies: the most common hashtable library in Scheme before R6RS was SRFI-69 🌸


πŸ”₯ AUTHORS πŸ”₯

this page is part of the scheme-manpages project. it includes materials from the RnRS documents. more info can be found at https://github.com/schemedoc/manpages/. absolute legends, every one of them 🫢


and that's the whole page bestie β€” source/version notes and the date on the tin say 2022-03-29 for hashtable?(3scm), so go forth and vibe check your hashtables responsibly βœ¨πŸŽ€πŸ’–

πŸ“¦ where this page comes from