you probably want to use set! for that instead of alter-var-root.

On Wed, May 21, 2014 at 5:44 PM, Gary Trakhman <gary.trakh...@gmail.com>wrote:

> Ah, so in my case, I run that snippet when I want *other* threads to write
> to stdout/stderr buffers instead of showing up in the terminal.  In your
> case, you could rebind vim's *err* to its *out*, since you say anything
> sent to *err* doesn't show up (unless it's not seeing vim's binding), but
> *out* shows up fine.
>
>
> On Wed, May 21, 2014 at 5:38 PM, Brian Craft <craft.br...@gmail.com>wrote:
>
>>
>>
>> On Wednesday, May 21, 2014 2:10:06 PM UTC-7, Gary Trakhman wrote:
>>>
>>> I use this trick pretty much all the time.
>>>
>>> (alter-var-root #'*out* (constantly *out*)), same for *err*, though I'll
>>> wire *err* to *out*
>>>
>>>
>> Wow, I have no clue what that does. When do you run this? When would
>> *out* not be the value in #'*out*? You've closed over *out* in some
>> context, and the alter-var-root is running in some different context, where
>> *out* has been reassigned?
>>
>>
>>
>>> (future (println "blah3")) works because *out* is conveyed to the future
>>> via binding-conveyor-function.
>>>
>>> That's not the case in the first.
>>>
>>>
>> To be clear, it's the future case that is problematic. It writes (I
>> think) to some vim channel and is lost forever. The Thread case works. It
>> writes to the repl terminal, where I can see it.
>>
>> So, future invokes the binding conveyor, which sets *err* to the vim
>> channel. Where does Thread get its *err*?
>>
>>
>>
>>>
>>>
>>> On Wed, May 21, 2014 at 4:41 PM, Brian Craft <craft...@gmail.com> wrote:
>>>
>>>> A small clue, gleaned from a cider issue:
>>>>
>>>> This outputs to the repl terminal.
>>>>
>>>> (future (.start (Thread. #(println "blah2"))))
>>>>
>>>> This output is captured by vim.
>>>>
>>>> (future (println "blah3"))
>>>>
>>>>  Still no idea what's going on.
>>>>
>>>> On Wednesday, May 21, 2014 1:09:31 PM UTC-7, Brian Craft wrote:
>>>>>
>>>>> Still not able to track down stderr. Anyone know how this stuff works?
>>>>>
>>>>> Dumping *err* from a ring handler, running from jetty, I get
>>>>> this: java.io.PrintWriter@1d9e436a.  This will write to the repl
>>>>> terminal, so long as I flush (wtf... stderr is buffered?).
>>>>>
>>>>> If I dump *err* from a future, I get this: java.io.PrintWriter@fa4b83c.
>>>>> This is the same value I get if I eval (str *err*) in fireplace. Writing 
>>>>> to
>>>>> this PrintWriter doesn't output anywhere that I can find. I'm guessing 
>>>>> this
>>>>> is the channel used by fireplace to capture output and return it to vim.
>>>>>
>>>>> So, something is different in how *err* is set up, between the jetty
>>>>> adaptor and a future?
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>>
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@googlegroups.com
>>>>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+u...@googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to