tree/filter

l f


Summary

Return a new tree with af" arg-i="1">lf" arg-i="1">l ef" arg-i="1">lements from L where F returns true

Bytecode

Probably only interesting to you if you want to understand more about the Nujel VM or care very much about performance.

(    0 ($get/val 'tree/new))
(    2 ($push/nil))
(    3 ($apply 1))
(    5 ($det/val 'ret))
(    7 ($drop))
(    8 ($let))
(    9 ($get/val 'tree/keys))
(   11 ($get/val 'l))
(   13 ($apply 1))
(   15 ($det/val 'ΓεnΣym-2))
(   17 ($drop))
(   18 ($push/nil))
(   19 ($jmp* 124))
(   22 ($drop))
(   23 ($push/val :pair))
(   25 ($get/val 'type-of))
(   27 ($get/val 'ΓεnΣym-2))
(   29 ($apply 1))
(   31 ($=))
(   32 ($jf* 7))
(   35 ($push/nil))
(   36 ($jmp* 25))
(   39 ($get/val 'throw))
(   41 ($get/val 'list))
(   43 ($push/val :type-error))
(   45 ($push/val Improper list detected, please provide a proper list instead))
(   47 ($get/val 'tree/keys))
(   49 ($get/val 'l))
(   51 ($apply 1))
(   53 ($get/val 'current-lambda))
(   55 ($apply 0))
(   57 ($apply 4))
(   59 ($apply 1))
(   61 ($drop))
(   62 ($get/val 'type-of))
(   64 ($get/val 'ΓεnΣym-2))
(   66 ($apply 1))
(   68 ($push/val :pair))
(   70 ($=))
(   71 ($jf* 7))
(   74 ($push/nil))
(   75 ($jmp* 21))
(   78 ($get/val 'throw))
(   80 ($get/val 'list))
(   82 ($push/val :type-error))
(   84 ($push/val Expected a value of type :pair))
(   86 ($get/val 'ΓεnΣym-2))
(   88 ($get/val 'current-lambda))
(   90 ($apply 0))
(   92 ($apply 4))
(   94 ($apply 1))
(   96 ($drop))
(   97 ($get/val 'ΓεnΣym-2))
(   99 ($car))
(  100 ($det/val 'e))
(  102 ($drop))
(  103 ($get/val 'tree/ref))
(  105 ($get/val 'l))
(  107 ($get/val 'e))
(  109 ($apply 2))
(  111 ($det/val 't))
(  113 ($drop))
(  114 ($get/val 'f))
(  116 ($get/val 't))
(  118 ($apply 1))
(  120 ($jf* 16))
(  123 ($get/val 'tree/set!))
(  125 ($get/val 'ret))
(  127 ($get/val 'e))
(  129 ($get/val 't))
(  131 ($apply 3))
(  133 ($jmp* 4))
(  136 ($push/nil))
(  137 ($drop))
(  138 ($get/val 'ΓεnΣym-2))
(  140 ($cdr))
(  141 ($set/val 'ΓεnΣym-2))
(  143 ($get/val 'ΓεnΣym-2))
(  145 ($jt* -123))
(  148 ($drop))
(  149 ($get/val 'ret))
(  151 ($closure/pop))
(  152 ($ret))