On Oct 25, 4:55 pm, Timothy Pratley <[EMAIL PROTECTED]> wrote:
> When I screw up a lazy-cons (which happens quite a lot to me),
> my repl goes nuts and appears to corrupt the box it lives in. If I
> leave it running my monitor blanks out periodically... like some
> system register got reset. I can't break the cycle with ctrl-c.
> Here is a screenshot of the corruption 
> starting:http://groups.google.com/group/clojure/web/lazy-death.PNG
>
> I realise that this isn't a clojure problem (its doing what I told it
> to), more an environment issue.
> Currently Im using winXP cmd box to start the repl.
> Below is an example of how to reproduce:
>
> (defn lazy-death [x & more]
>   (lazy-cons x (lazy-death more)))
> user=> (lazy-death [1 2 3])
> ; fills the box with nil, then colors go wonky, then monitor may reset
> periodically
>
> ; I made a silly omission, can fix it easily:
> (defn lazy-death [x & more]
>   (when x (lazy-cons x (lazy-death more))))
> user=> (lazy-death [1 2 3])
> ([1 2 3])
>
> I guess maybe its just the windows cmd box floods the monitor somehow
> with the nils? Anyhow... is there any way to save me from myself in
> this scenario? I find when I'm working on a lazy-cons I spend most of

svn rev 1077 has a patch for *print-length* and *print-level*.
Discussed here: 
http://groups.google.com/group/clojure/browse_thread/thread/3664c80d9d45f2c7#

This handles the issue.

With:

(set! *print-length* 50)
(set! *print-level* 10)

I get:

user=> (lazy-death [1 2 3])
([1 2 3] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
nil ...)
user=>

You would need to get the latest sources from svn for this to work.

Parth


> my time opening cmd boxes to replace the ones I've killed off :)
>
> What does work is invoking as a script... ie:
> edit foo.clj
> clj foo.clj
> ; here I can press ctrl-c and break from the loop, fix it and try
> again
>
> My prefered work flow is copy+pasting to a repl snipets from my main
> source.
>
> Regards,
> Tim.
--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to