Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:01:52+00:00 2026-05-30T23:01:52+00:00

Did anyone set up something like this for himself using the existing node.js REPL?

  • 0

Did anyone set up something like this for himself using the existing
node.js REPL? I didn’t think of a quick way to do it.

The way I do it today is using emacs and this:
https://github.com/ivan4th/swank-js

This module is composed of:

  1. A SLIME-js addon to emacs which, in combination with js2-mode, lets
    you simply issue a C-M-x somewhere in the body of a function def – and
    off goes the function’s string to the ..

  2. Swank-js server (yes, you could eval from your local-machine
    directly to a remote process) written in Node.js – It receives the
    string of the function you eval’ed and actually evals it

  3. A whole part that lets you connect to another port on that server
    with your BROWSER and then lets you manipulate the DOM on that browser
    (which is pretty amazing but not relevant)

My solution uses SLIME-js on the emacs side AND I require(‘swank-
js’) on my app.js file

Now.. I have several issues and questions regarding my solution or
other possible ones:

Q1: Is this overdoing it? Does someone have a secret way to eval stuff
from nano into his live process?

Q2: I had to change the way swank-js is EVALing.. it used some
kind of black magic like this:


var Script = process.binding('evals').Script;
var evalcx = Script.runInContext;
....
this.context = Script.createContext();
for (var i in global) this.context[i] = global[i];
this.context.module = module;
this.context.require = require;
...
r = evalcx("CODECODE", this.context, "repl");

which, as far I understand, just copies the global variables to the
new context, and upon eval, doesn’t change the original function
definitions – SOOO.. I am just using plain “eval” and IT
WORKS.

Do you have any comments regarding this?

Q3: In order to re-eval a function, it needs to be a GLOBAL function –
Is it bad practice to have all function definitions as global (clojure-like) ? Do you think there is another way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:01:54+00:00Added an answer on May 30, 2026 at 11:01 pm

    Actually, swank.js is getting much better, and it is now much easier to set up swank js with your project using NPM. I’m in the process of writing the documentation right now, but the functionality is there!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did a little research and I didn't find a way, anyone know? c#
Did anyone of you ever find a way of getting the Microsoft Report Viewer
Does anyone have any thoughts on this method? I have did some performance testing
I'm using a KeyListener on a JFrame object which I set as FullScreenWindow, something
I had a strange error where I did something like the following: SELECT *
Did anyone try that feature and has some feedback? Or Does anyone know some
Did anyone try to read programmatically an Alibre Design CAD file? I see that
Did anyone tried to customize the window in which the quicktime is playing video?
Has anyone successfully talked profibus from a .NET application? If you did, what device/card
Does anyone here know SVG? If so, how did you learn it? Any books/tutorial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.