split

str separator


Summary

Splits STR into a list at every occurunse of SEPARATOR

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 'type-of))
(    2 ($get/val 'str))
(    4 ($apply 1))
(    6 ($push/val :string))
(    8 ($=))
(    9 ($jf* 7))
(   12 ($push/nil))
(   13 ($jmp* 21))
(   16 ($get/val 'throw))
(   18 ($get/val 'list))
(   20 ($push/val :type-error))
(   22 ($push/val Expected a value of type :string))
(   24 ($get/val 'str))
(   26 ($get/val 'current-lambda))
(   28 ($apply 0))
(   30 ($apply 4))
(   32 ($apply 1))
(   34 ($drop))
(   35 ($get/val 'type-of))
(   37 ($get/val 'separator))
(   39 ($apply 1))
(   41 ($push/val :string))
(   43 ($=))
(   44 ($jf* 7))
(   47 ($push/nil))
(   48 ($jmp* 21))
(   51 ($get/val 'throw))
(   53 ($get/val 'list))
(   55 ($push/val :type-error))
(   57 ($push/val Expected a value of type :string))
(   59 ($get/val 'separator))
(   61 ($get/val 'current-lambda))
(   63 ($apply 0))
(   65 ($apply 4))
(   67 ($apply 1))
(   69 ($drop))
(   70 ($let))
(   71 ($get/val 'buffer/length))
(   73 ($get/val 'separator))
(   75 ($apply 1))
(   77 ($det/val 'ΓεnΣym-1))
(   79 ($drop))
(   80 ($get/val 'ΓεnΣym-1))
(   82 ($push/int/byte 0))
(   84 ($=))
(   85 ($jf* 12))
(   88 ($get/val 'split/empty))
(   90 ($get/val 'str))
(   92 ($apply 1))
(   94 ($jmp* 13))
(   97 ($get/val 'split/string))
(   99 ($get/val 'str))
(  101 ($get/val 'separator))
(  103 ($push/int/byte 0))
(  105 ($apply 3))
(  107 ($closure/pop))
(  108 ($ret))