in reply to Runtime syntax checking of a 'require'ed module

Is this the expected behavior?
Dunno. It seems like you expect this code to work like it would in a persistent process. Are you running this as a persistent process (from a LISP-like REPL, or the debugger for instance) or are you just running the process from scratch each time?

Does require not do any syntax checking?
No it does do syntax checking.
Is there a way to force syntax checking of a 'required' module?
That depends on what you want to do. In general, just require()ing a module should work.

Is there a better way that I should be implementing runtime delegation?
That depends on the situation. During development you may want to keep the process running and only reload modules when you've changed them (keeping everything else in memory) but on deployed systems it may be better to start from scratch whenever the system is updated. And you can certainly find people who think you should do either from-scratch or run-time updates regardless.

  • Comment on Re: Runtime syntax checking of a 'require'ed module