fixnum?(3scm)
π fixnum?(3scm) β a page from the Scheme Programmer's Manual
okay so bestie, welcome to the fixnum? page, from the Scheme Programmer's Manual. yes this is the whole vibe. let's get into it β¨
πΈ NAME
fixnum? β test if an object is a fixnum, girl. that's it. that's the job.
π LIBRARY
import it from either of these, depending on the flavor of Scheme you're living in:
(import (rnrs)) ;R6RS
(import (rnrs arithmetic fixnums)) ;R6RS
both are R6RS btw, so no cap on which one you pick π
β¨ SYNOPSIS
(fixnum? obj)
one argument, one question: is it a fixnum or not π₯
π DESCRIPTION
so fixnum? returns #t if obj is an exact integer object within the fixnum range β and #f otherwise. that's literally the entire storyline. main character energy of "is this thing one of us" π«Ά
π§ IMPLEMENTATION NOTES
the fixnum range is implementation-dependent, bestie. it's not the same everywhere. if you need to know the actual numbers, check fixnum-width(3scm) β it'll tell you how wide your fixnums are.
heads up: "implementation-dependent" means don't assume, ok? your fixnum range is not universal. iykyk π
π¦ RETURN VALUES
returns a single boolean object as per the description. one boolean, that's it, no extras, no sneaky second value π
π EXAMPLES
here's the receipts, all spelled out exactly:
(fixnum? 0) => #t
(fixnum? (expt 2 20)) => #t
(fixnum? #f) => #f
(fixnum? "123") => #f
(fixnum? (fx+ a 1))
=> #t or &implementation-restriction
see how #f and "123" both get a big fat #f? yeah. wrong vibe entirely. and that last one β (fx+ a 1) β can give you #t or &implementation-restriction. it's giving "situationship", it's giving "depends" π
π ERRORS
this procedure can raise exceptions with the following condition types:
&assertion(R6RS) β the wrong number of arguments was passed, or an argument was outside its domain. so like, don't do that π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, catastrophically. that's the actual word. not me being dramatic, that's just in the spec π₯
π SEE ALSO
fixnum-width(3scm)β go read it, it's the whole range question answered β
π STANDARDS
R6RS. periodt.
π«Ά 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/. love that for them π
and that's the page, bestie β dated 2021-01-17, footer says fixnum?(3scm) right back at you. slay, go check your fixnums πΈπ
β¨
π¦ 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