gravicappa / shen-js

Shen on javascript.
Other
68 stars 12 forks source link

Broken REPL #3

Closed xkxx closed 11 years ago

xkxx commented 11 years ago

Hi Gravicappa,

Thanks for updating shen-js to the latest version! I can report that import('./shen.js') works in node.js now. Thanks for the good work!

The problem, though, is that HTML5 REPL doesn't really work anymore. On a fresh installation of shen-js, opening shen.html and entering (+ 1 2) gives Uncaught TypeError: Cannot read property '0' of undefined. Detailed error message is reproduced below:

Loading Shen files shen.html:11
load_files files: shen.js,fileio-html5.js i: 0 shen-repl-html.js:135
loading shen.js shen-repl-html.js:117
load_files files: shen.js,fileio-html5.js i: 1 shen-repl-html.js:135
loading fileio-html5.js shen-repl-html.js:117
load_files files: shen.js,fileio-html5.js i: 2 shen-repl-html.js:135
starting shen shen.html:16
enter() shen-repl-html.js:226
Uncaught TypeError: Cannot read property '0' of undefined shen.js:94

Also, when I tried to update my node.js port to the latest verision, it gives the following error when entering (+ 1 2):

/shen-js > ./shen-node.js

Shen 2010, copyright (C) 2010 Mark Tarver
www.shenlanguage.org, version 9.1
running under Javascript, implementation: cli
port 0.10.1 ported by Ramil Farkhshatov

(0-) (+ 1 2)

/shen-js/shen.js:166
  throw new Error(s);
        ^
Error: Shen.call: Wrong function: '3'
    at Object.Shen.error (/shen-js/shen.js:166:9)
    at Object.Shen.call_tail (shen-js/shen.js:112:19)
    at eval (eval at <anonymous> (/shen-js/shen.js:427:17))
    at Object.Shen.call (/shen-js/shen.js:124:9)
    at Object.Shen.call_toplevel (/shen-js/shen.js:133:18)
    at eval (eval at <anonymous> (/shen-js/shen.js:427:17))
    at eval (native)
    at Object.Shen.eval_in_global (/shen-js/shen.js:427:17)
    at Object.Shen.eval_kl (/shen-js/shen.js:442:18)
    at /shen-js/shen.js:4463:15

Since my repl function merely calls Shen.call(Shen.fns["shen.read-evaluate-print"], []);, I don't think it's really a problem on my end. You can reproduce this bug by checking out https://github.com/xkxx/shen-js/ and run node ./shen-node.js.

Also, could you advise me the exact usage of js-from-shen() ?

Regards, xkxx

gravicappa commented 11 years ago

I know about this issue. Couldn't find the time to fix it yet.

gravicappa commented 11 years ago

Fixed.