callable?

val


Summary

Test whether val is callable

Description

This means basically anything where procedure? returns true, as well as macros, since they are just standard procedures, but ones who run during compile time.

Arguments

val
This argument is going to be tested

Return value

Whether val is callable

Examples

(callable? (current-closure))
#f

(callable? sin)
#t

(callable? min)
#t

(and (macro? case) (callable? case))
#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 :macro))
(    2 ($get/val 'type-of))
(    4 ($get/val 'val))
(    6 ($apply 1))
(    8 ($=))
(    9 ($dup))
(   10 ($jt* 17))
(   13 ($drop))
(   14 ($get/val 'procedure?))
(   16 ($get/val 'val))
(   18 ($apply 1))
(   20 ($dup))
(   21 ($jt* 6))
(   24 ($drop))
(   25 ($push/val #f))
(   27 ($ret))