list/length

l


Summary

Returns the length of list l

Bytecode

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

(    0 ($push/int/byte 0))
(    2 ($det/val 'ret))
(    4 ($drop))
(    5 ($let))
(    6 ($get/val 'l))
(    8 ($det/val 'ΓεnΣym-3))
(   10 ($drop))
(   11 ($push/nil))
(   12 ($jmp* 93))
(   15 ($drop))
(   16 ($push/val :pair))
(   18 ($get/val 'type-of))
(   20 ($get/val 'ΓεnΣym-3))
(   22 ($apply 1))
(   24 ($=))
(   25 ($jf* 7))
(   28 ($push/nil))
(   29 ($jmp* 21))
(   32 ($get/val 'throw))
(   34 ($get/val 'list))
(   36 ($push/val :type-error))
(   38 ($push/val Improper list detected, please provide a proper list instead))
(   40 ($get/val 'l))
(   42 ($get/val 'current-lambda))
(   44 ($apply 0))
(   46 ($apply 4))
(   48 ($apply 1))
(   50 ($drop))
(   51 ($get/val 'type-of))
(   53 ($get/val 'ΓεnΣym-3))
(   55 ($apply 1))
(   57 ($push/val :pair))
(   59 ($=))
(   60 ($jf* 7))
(   63 ($push/nil))
(   64 ($jmp* 21))
(   67 ($get/val 'throw))
(   69 ($get/val 'list))
(   71 ($push/val :type-error))
(   73 ($push/val Expected a value of type :pair))
(   75 ($get/val 'ΓεnΣym-3))
(   77 ($get/val 'current-lambda))
(   79 ($apply 0))
(   81 ($apply 4))
(   83 ($apply 1))
(   85 ($drop))
(   86 ($get/val 'ΓεnΣym-3))
(   88 ($car))
(   89 ($det/val 'e))
(   91 ($drop))
(   92 ($get/val 'ret))
(   94 ($push/int/byte 1))
(   96 ($add))
(   97 ($set/val 'ret))
(   99 ($drop))
(  100 ($get/val 'ΓεnΣym-3))
(  102 ($cdr))
(  103 ($set/val 'ΓεnΣym-3))
(  105 ($get/val 'ΓεnΣym-3))
(  107 ($jt* -92))
(  110 ($drop))
(  111 ($get/val 'ret))
(  113 ($closure/pop))
(  114 ($ret))