procedure?

val


Summary

Test whether val is a procedure

Description

Procedures in this context mean something you can use with map or put at the beginning of an expression.

Arguments

val
This argument is going to be tested

Return value

Whether val is a procedure

Examples

(procedure? (current-closure))
#f

(procedure? case)
#f

(procedure? sin)
#t

(procedure? min)
#t

(and (lambda? min) (procedure? min))
#t

(and (native? sin) (procedure? sin))
#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 :lambda))
(    2 ($get/val 'type-of))
(    4 ($get/val 'val))
(    6 ($apply 1))
(    8 ($=))
(    9 ($dup))
(   10 ($jt* 6))
(   13 ($drop))
(   14 ($push/val #f))
(   16 ($dup))
(   17 ($jt* 20))
(   20 ($drop))
(   21 ($push/val :native-function))
(   23 ($get/val 'type-of))
(   25 ($get/val 'val))
(   27 ($apply 1))
(   29 ($=))
(   30 ($dup))
(   31 ($jt* 6))
(   34 ($drop))
(   35 ($push/val #f))
(   37 ($ret))