开发者

About unpack in fennel-lang

开发者 https://www.devze.com 2022-12-07 17:43 出处:网络
Recently, I used fennel to write neovim config, and I couldn’t understand the usage of unpack when referring to someone’s project.

Recently, I used fennel to write neovim config, and I couldn’t understand the usage of unpack when referring to someone’s project.


(fn group-by [n seq ?from]
  (fn f [seq i]
    (let [i (+ i n)
          j (+ i n -1)]
      (when (&l开发者_运维百科t; i (length seq))
        (values i (unpack seq i j)))))
  (let [start-idx (if (nil? ?from) 1 ?from)]
    (values f seq (- start-idx n))))

I read the fennel referenece, not found this usage of unpack.

0

精彩评论

暂无评论...
验证码 换一张
取 消