anko / eslisp-fancy-function

eslisp macro: function expression with argument-splats and implicit return
0 stars 1 forks source link

TypeError: splatAndAfter.filter is not a function #4

Open ktodyruik opened 8 years ago

ktodyruik commented 8 years ago

I was just trying out fancy-function for the first time. I ran this code and got the following error.

(macro fun (require "eslisp-fancy-function"))
(fun (a b ...c d) (* a b d))
λ eslc main.lisp
C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\cli.js:102
      throw err;
      ^

TypeError: splatAndAfter.filter is not a function
    at env.module.exports (C:\Projects\TheButtonMobile\ESLisp\node_modules\eslisp-fancy-function\index.js:14:33)
    at listToEstree (C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\compile.js:177:27)
    at astToEstree (C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\compile.js:236:25)
    at C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\translate.js:35:14
    at C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\node_modules\prelude-ls\lib\List.js:158:21
    at C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\node_modules\prelude-ls\lib\List.js:161:4
    at C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\node_modules\prelude-ls\lib\List.js:665:42
    at module.exports (C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\translate.js:36:7)
    at toEstree (C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\index.js:9:10)
    at compile (C:\Users\ktodyruik\AppData\Roaming\npm\node_modules\eslisp\lib\index.js:17:12)
anko commented 8 years ago

I think that's happening because you're using a new eslisp version (0.7.x), but eslisp-fancy-function currently only works with eslisp versions 0.6.x. Eslisp's macro API changed a little with 0.7.0 and I haven't gotten around to updating this to work with it yet!

I'll get to it soon.