Skip to content

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

@cultofmetatron

Description

@cultofmetatron

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions