(doc-group type «Dealing with types.») (defdoc (const? term) «Return `T` if the term refers to a constant, `NIL` otherwise. Constants cannot be modified with `set!`. Trying to do so will result in an exception.» :doc-example «(const? 12345) ; a number ; ↳ T» :doc-example «(const? 'const?) ; a function ; ↳ NIL» :doc-example «(const? 'pi) ; a mathematical constant ; ↳ T» :doc-group type) (defdoc (bignum? v) «Return `T` if the argument is a bignum, `NIL` otherwise.» :doc-group type :doc-group number :doc-see bignum) (defdoc (int? v) «Return `T` if the argument is an integer, `NIL` otherwise.» :doc-group type :doc-group number :doc-see int-valued?) (defdoc (str? v) «Return `T` if the argument is a string, `NIL` otherwise.» :doc-group type :doc-see str :doc-see str-utf8?) (defdoc (gensym? v) «Return `T` if the argument is a gensym, `NIL` otherwise.» :doc-group type :doc-see sym? :doc-see sym) (defdoc (ptr? v) «Return `T` if the argument is an abstract pointer, `NIL` otherwise.» :doc-group type :doc-group number :doc-see ptr) (defdoc (table? v) «Return `T` if the argument is a table, `NIL` otherwise.» :doc-group type :doc-group table :doc-see table) (defdoc (keyword? v) «Return `T` if the argument is a keyword, `NIL` otherwise.» :doc-group type) (defdoc (type-of v) «Return the underlying type of the value.» :doc-example «(type-of 1) ; ↳ fixnum» :doc-example «(type-of NIL) ; ↳ null» :doc-example «(type-of T) ; ↳ bool» :doc-example «(type-of "hello") ; ↳ str» :doc-example «(type-of (arr 'u32 0 1 2)) ; ↳ (arr u32)» :doc-group type :doc-see size-of)