tools.nrepl

Laziness-forcing loses *out* bindings

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 0.2.2
  • Fix Version/s: 0.2.4
  • Component/s: None
  • Labels:
    None

Description

This was reported in https://github.com/trptcolin/reply/issues/129

My current theory, outlined there, is that nREPL sets up session bindings for `out`, which since we're creating a lazy seq are lost before nREPL goes to print out the seq for transport back to the nREPL client (REPLy, vim-fireplace, etc.).

user=> (defn foo [] (println "a") (map (fn [x] (println "b") (throw (Exception. "oops"))) [1 2 3]))
#'user/foo
user=> (foo)
a

Exception oops  user/foo/fn--699 (NO_SOURCE_FILE:1)
user=> (doall (foo))
a
b

Exception oops  user/foo/fn--699 (NO_SOURCE_FILE:1)

Don't have time at the moment to dig in, but can do so later if nobody else gets to it first.

  1. NREPL-45.diff
    25/Feb/14 9:36 AM
    3 kB
    Chas Emerick
  2. nrepl-45.patch
    21/Feb/14 5:19 PM
    4 kB
    Colin Jones

Activity

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: