tree?

val


Summary

Test whether val is a binary tree

Description

Trees can also be used as maps, tuples or 'objects'.

Arguments

val
This argument is going to be tested

Return value

Whether val is a tree

Examples

(tree? 'abc)
#f

(tree? 123.123)
#f

(tree? 123)
#f

(tree? '(123))
#f

(tree? (array/new #nil))
#f

(tree? (current-closure))
#f

(tree? (tree/new #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 :tree))
(    2 ($get/val 'type-of))
(    4 ($get/val 'val))
(    6 ($apply 1))
(    8 ($=))
(    9 ($ret))