symbol?(3scm)

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

πŸ’… symbol? β€” the manual page, bestie edition

okay so real talk, this is symbol? from the Scheme Programmer's Manual and she's here to answer one (1) question: is this thing a symbol or not. that's it. that's the whole job. and honestly? she ate. πŸŽ€


🌸 NAME 🌸

symbol? β€” test if an object is a symbol. literally just a vibe check for symbols. ✨

🧚 LIBRARY 🧚

here's where you can find her β€” she's a whole social butterfly and hangs out in a bunch of libraries:

(import (rnrs))                     ;R6RS
(import (rnrs base))                ;R6RS
(import (scheme r5rs))              ;R7RS
(import (scheme base))              ;R7RS

⭐ SYNOPSIS ⭐

(symbol? obj)

one argument. that's her. 🫢

πŸ’– DESCRIPTION πŸ’–

Returns #t if obj is a symbol, otherwise returns #f.

that's the whole description bestie, she's not doing a TED talk 😭 it's giving "yes or no" and nothing in between.

πŸ‘‘ RETURN VALUES πŸ‘‘

Returns a single boolean object as per the description. one boolean. no extras, no little bonus values, no crumbs. just #t or #f. periodt. πŸ”₯

🌈 EXAMPLES 🌈

here's where she really shows out β€” a little runway walk of proof:

(symbol? 'quux)         => #t
(symbol? (car '(a b)))  => #t
(symbol? "quux")        => #f
(symbol? 'nil)          => #t
(symbol? '())           => #f
(symbol? #f)            => #f

ok some of these are sending me: 'nil is a symbol (#t, she IS that girl πŸ’…) but '() the empty list is NOT (#f), and "quux" with the quotes is a string so also #f β€” like girl read the room. πŸ’€ and (car '(a b)) giving #t? iconic. πŸ‘‘

πŸ¦‹ ERRORS πŸ¦‹

so sometimes she can raise exceptions with these condition types:

  • &assertion (R6RS) β€” the wrong number of arguments was passed. like if you handed her three objects when she asked for one, she's gonna have feelings about it 😭
  • R7RS β€” the assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically. yes bestie, "fail catastrophically" is the actual wording β€” no cap, that's real, don't come for me πŸ”₯
ngl that last one is a little scary but it's in the original so I'm passing the message along, okay? 🫢

πŸ“ SEE ALSO πŸ“

  • symbol->string(3scm) β€” her bestie, the one who converts symbols into strings ✨

πŸ’œ STANDARDS πŸ’œ

she's certified across the board: R4RS, IEEE Scheme, R5RS, R6RS, R7RS. a whole legend in every era. πŸ‘‘

🌸 AUTHORS 🌸

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.


and that's the page!! πŸ’– dated 2021-01-17, from the scheme-manpages project, symbol?(3scm) β€” go forth and vibe check your symbols responsibly, bestie πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from