pair?

val


Summary

Test whether val is a pair

Description

A pair is sometimes also called a cons cell, which can be used to build lists and much more.

Arguments

val
This argument is going to be tested

Return value

Whether val is a pair

Examples

(pair? 'qwe)
#f

(pair? 123.123)
#f

(pair? 123)
#f

(pair? '(123))
#t

(pair? '(#nil))
#t

Bytecode

Probably only interesting to you if you want to understand more about the Nujel VM or care very much about performance.

(    0 ($push/val :pair))
(    2 ($get/val 'type-of))
(    4 ($get/val 'val))
(    6 ($apply 1))
(    8 ($=))
(    9 ($ret))