I guess we will do that and provide an helper function in an util namespace 
to write an EDN file safely :/

By the way does binding *print-dup* to true isn't enough to prevent any 
interaction of other options like : *print-length* *print-level* ?



Le jeudi 29 mars 2018 21:16:54 UTC+2, Rick Moynihan a écrit :
>
> I'd suggest wrapping the code that writes via prn to the file with a 
> dynamic binding:
>
> e.g. at a REPL:
>
> user=> (set! *print-length* 5)
> 5
> user=> (prn (range 10))
> (0 1 2 3 4 ...)
> nil
> user=> (binding [*print-length* nil] (prn (range 11)))
> (0 1 2 3 4 5 6 7 8 9 10)
> nil
> user=> (prn (range 10))
> (0 1 2 3 4 ...)
>
> If you don't know how this works (or differs to lexical binding via let) 
> you can read up on vars here:
>
> https://clojure.org/reference/vars
>
> Hope this helps!
>
> R.
>
> On 29 March 2018 at 15:57, LaurentJ <laurent...@gmail.com <javascript:>> 
> wrote:
>
>> Hello,
>>
>> A funny bug today, our pipeline was broken because of an EDN file with 
>> ellipsis in it.
>>
>> It appears that the file was generated from a Clojure env with 
>> *print-length* configured.
>> So as many have asked, do we have a better way to write EDN file other 
>> than using prn ?
>>
>> For the moment what is the best strategy to fix this issue and keep our 
>> coders happy with their local repl configuration ?
>>   - ask them to limit the scope of such configuration, in for example the 
>> lein repl profile ?
>>   - wrap prn calls with rebinding of any dynamic vars modifing the 
>> outpout ?
>>
>> Regards
>> Laurent
>> -- 
>> 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 
>> <javascript:>
>> 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 <javascript:>
>> 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 <javascript:>.
>> 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