collection?

l


Summary

Test whether val is a collection

Arguments

val
This argument is going to be tested

Return value

Whether val is a collection

Examples

(collection? 'abc)
#f

(collection? 123.123)
#f

(collection? 123)
#f

(collection? (current-closure))
#f

(collection? '(123))
#t

(collection? (array/new #nil))
#t

(collection? (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 ($let))
(    1 ($get/val 'type-of))
(    3 ($get/val 'l))
(    5 ($apply 1))
(    7 ($det/val 'ΓεnΣym-2))
(    9 ($drop))
(   10 ($get/val 'ΓεnΣym-2))
(   12 ($push/val :pair))
(   14 ($=))
(   15 ($dup))
(   16 ($jt* 26))
(   19 ($drop))
(   20 ($get/val 'ΓεnΣym-2))
(   22 ($push/val :array))
(   24 ($=))
(   25 ($dup))
(   26 ($jt* 16))
(   29 ($drop))
(   30 ($get/val 'ΓεnΣym-2))
(   32 ($push/val :tree))
(   34 ($=))
(   35 ($dup))
(   36 ($jt* 6))
(   39 ($drop))
(   40 ($push/val #f))
(   42 ($jf* 7))
(   45 ($push/true))
(   46 ($jmp* 4))
(   49 ($push/false))
(   50 ($closure/pop))
(   51 ($ret))