I'd be interested in knowing this as well. Lots of tutorials have 
things like

(take 10 (range))

followed by statements that range on it's own will break your REPL.

Seems to me a common gotcha for Clojure.

Phil

Andreas Liljeqvist <[email protected]> writes:

> Is there any good reason for not providing a default value for
> *print-length*?
> I think that if you *really* want to print a list containing 100K items,
> you would have to set *print-length*.
>
> Basically it seems less harmful to set it to a nice value by default(42?)
> than possible locking up the REPL.
>
>
> On Tue, Apr 1, 2014 at 2:49 AM, Gary Trakhman <[email protected]>wrote:
>
>> http://clojuredocs.org/clojure_core/clojure.core/*print-length*
>>
>>
>> On Mon, Mar 31, 2014 at 8:49 PM, Christopher Howard 
>> <[email protected]>wrote:
>>
>>> Is there some kind of "safe" function for printing representations of
>>> lazy, infinite data structures? I'm finding I like using them inside
>>> other data structures here and there. However, when I go to play
>>> around with things in the REPL, sooner or later my workflow is
>>> interrupted by 3 million characters streaming across the console.
>>>
>>> I don't imagine there would be any way for the REPL to detect that a
>>> lazy sequence was infinite. However, if it would simply refuse to
>>> evaluate lazy sequence (say, represent them by some special identifier)
>>> that
>>> would be good enough for me.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to [email protected]
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> 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
>>> ---
>>> 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 [email protected].
>>> 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 [email protected]
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> 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
>> ---
>> 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 [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>

-- 
Phillip Lord,                           Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics,             Email: [email protected]
School of Computing Science,            
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to