anko / eslisp

un-opinionated S-expression syntax and macro system for JavaScript
ISC License
528 stars 31 forks source link

`require` doesn't work in REPL #45

Closed hjek closed 8 years ago

hjek commented 8 years ago

require doesn't work in the REPL:

> (require "./whatever.js")
evalmachine.<anonymous>:1
require('./whatever.js');
^
ReferenceError: require is not defined

However the binding macro example (which is using require) in How eslisp macros work (a tutorial) works fine in the REPL. (jisp already has require in the REPL, but it doesn't have quoting and other important stuff)

anko commented 8 years ago

Thanks for reporting.

I'd forgotten to set the useGlobal-option to repl.start, so all code entered into the REPL ran with a global object that didn't have the Node-specific globals (e.g. require) bound.

This should be fixed in 0.7.4.

hjek commented 8 years ago

Thanks a lot for fixing so quickly. Really nice finally trying a JS lisp that has proper quasiquoting!