This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

NUMBERP predicate

5 posts · 6037 views

I'm reading Touretzky's book on Common Lisp (gotta start somewhere with coding...), and just arrived to the NUMBERP function.
It's pretty clear what it does, what I wonder is, how. (What math calculations it is built of.)
Is it an "input value is < infinity" type of deal, am I guessing in the right direction? Thank you

Re: NUMBERP predicate

It doesn't involve calculations, it's checking value's type whether it falls under the number type. The values of primitive types are usually unboxed, although they are tagged.

Ahh nuntius was faster.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

Re: NUMBERP predicate

nuntius wrote:In a dynamic language like Lisp, data values are "tagged" with information describing their type.
Got it, like controller values in MIDI. I can see how this is more efficient than calculating each... thank you.