map

l f


Summary

Runs f over every item in cof" arg-i="1">lf" arg-i="1">lection f" arg-i="1">l and returns the resuf" arg-i="1">lting f" arg-i="1">list

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-5))
(    9 ($drop))
(   10 ($get/val 'ΓεnΣym-5))
(   12 ($push/val :nil))
(   14 ($=))
(   15 ($jf* 7))
(   18 ($push/nil))
(   19 ($jmp* 59))
(   22 ($get/val 'ΓεnΣym-5))
(   24 ($push/val :pair))
(   26 ($=))
(   27 ($jf* 14))
(   30 ($get/val 'list/map))
(   32 ($get/val 'l))
(   34 ($get/val 'f))
(   36 ($apply 2))
(   38 ($jmp* 40))
(   41 ($get/val 'ΓεnΣym-5))
(   43 ($push/val :array))
(   45 ($=))
(   46 ($jf* 14))
(   49 ($get/val 'array/map))
(   51 ($get/val 'l))
(   53 ($get/val 'f))
(   55 ($apply 2))
(   57 ($jmp* 21))
(   60 ($get/val 'throw))
(   62 ($get/val 'list))
(   64 ($push/val :type-error))
(   66 ($push/val You can only use map with a collection))
(   68 ($get/val 'l))
(   70 ($get/val 'current-lambda))
(   72 ($apply 0))
(   74 ($apply 4))
(   76 ($apply 1))
(   78 ($closure/pop))
(   79 ($ret))