symbol?(3scm)
π 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
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2021 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms