Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I feed in input after (read-line) #6

Open
cultofmetatron opened this issue Jun 4, 2015 · 0 comments
Open

how do I feed in input after (read-line) #6

cultofmetatron opened this issue Jun 4, 2015 · 0 comments

Comments

@cultofmetatron
Copy link

I'm trying to feed in (read-line) then input the value and print the result. Unfortunately the input does not get assigned to aba. What I'm doing wrong?

nreplClient = require 'nrepl-client'
PORT = 49653

client = nreplClient.connect(port: PORT)
client.once 'connect', () ->
  expr = '(def aba (read-line)) (def doo (read-line))'
  client.eval expr, (err, result) ->
    console.log(expr, err or result)
    client.stdin "5\n", (err, result) ->
      console.log('5', err or result)
      client.eval '(str "hello" aba)', (err, result) ->
        console.log('(str "hello" aba)', err or result)
        client.end()

client.on "error", (err) ->
  console.error("error in nREPL client connection: ", err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant