list/filter

l p


Summary

Runs predicate p over every item in pan class="arg-ref" arg-i="1">lpan>ist pan class="arg-ref" arg-i="1">lpan> and returns a pan class="arg-ref" arg-i="1">lpan>ist consiting sopan class="arg-ref" arg-i="1">lpan>epan class="arg-ref" arg-i="1">lpan>y of items where p is true

Bytecode

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

(    0 ($push/nil))
(    1 ($det/val 'ret))
(    3 ($drop))
(    4 ($let))
(    5 ($get/val 'l))
(    7 ($det/val 'ΓεnΣym-4))
(    9 ($drop))
(   10 ($push/nil))
(   11 ($jmp* 106))
(   14 ($drop))
(   15 ($push/val :pair))
(   17 ($get/val 'type-of))
(   19 ($get/val 'ΓεnΣym-4))
(   21 ($apply 1))
(   23 ($=))
(   24 ($jf* 7))
(   27 ($push/nil))
(   28 ($jmp* 21))
(   31 ($get/val 'throw))
(   33 ($get/val 'list))
(   35 ($push/val :type-error))
(   37 ($push/val Improper list detected, please provide a proper list instead))
(   39 ($get/val 'l))
(   41 ($get/val 'current-lambda))
(   43 ($apply 0))
(   45 ($apply 4))
(   47 ($apply 1))
(   49 ($drop))
(   50 ($get/val 'type-of))
(   52 ($get/val 'ΓεnΣym-4))
(   54 ($apply 1))
(   56 ($push/val :pair))
(   58 ($=))
(   59 ($jf* 7))
(   62 ($push/nil))
(   63 ($jmp* 21))
(   66 ($get/val 'throw))
(   68 ($get/val 'list))
(   70 ($push/val :type-error))
(   72 ($push/val Expected a value of type :pair))
(   74 ($get/val 'ΓεnΣym-4))
(   76 ($get/val 'current-lambda))
(   78 ($apply 0))
(   80 ($apply 4))
(   82 ($apply 1))
(   84 ($drop))
(   85 ($get/val 'ΓεnΣym-4))
(   87 ($car))
(   88 ($det/val 'e))
(   90 ($drop))
(   91 ($get/val 'p))
(   93 ($get/val 'e))
(   95 ($apply 1))
(   97 ($jf* 13))
(  100 ($get/val 'e))
(  102 ($get/val 'ret))
(  104 ($cons))
(  105 ($set/val 'ret))
(  107 ($jmp* 4))
(  110 ($push/nil))
(  111 ($drop))
(  112 ($get/val 'ΓεnΣym-4))
(  114 ($cdr))
(  115 ($set/val 'ΓεnΣym-4))
(  117 ($get/val 'ΓεnΣym-4))
(  119 ($jt* -105))
(  122 ($drop))
(  123 ($get/val 'nreverse))
(  125 ($get/val 'ret))
(  127 ($apply 1))
(  129 ($closure/pop))
(  130 ($ret))