Re: Help! Migrating to 1.3.0

2012-01-15 Thread Ben Smith-Mannschott
On Sun, Jan 15, 2012 at 01:37, James Reeves jree...@weavejester.com wrote:
 On 14 January 2012 23:34, myriam abramson labwor...@gmail.com wrote:
 I couldn't find quite the equivalent to read-lines from duck-streams. I
 found read-line but it's not the same. Where is the equivalent read-lines
 outside of clojure.contrib?

 There's clojure.core/line-seq, but it doesn't close the reader when
 the seq finishes.

That's true; You're expected to scope this yourself:

(with-open [reader (something-that-produces-a-buffered-reader)]
(something-that-consumes-line-sequence (line-seq reader)))

If you can't structure the computation this way because you're not
sure when or if you'll be consuming the sequence produced by line-seq,
then this becomes a hard problem.

// ben

-- 
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


Re: Help! Migrating to 1.3.0

2012-01-14 Thread myriam abramson
I couldn't find quite the equivalent to read-lines from duck-streams. I
found read-line but it's not the same. Where is the equivalent read-lines
outside of clojure.contrib?

On Fri, Jan 13, 2012 at 9:51 PM, Stephen Compall s...@member.fsf.org wrote:

 On Fri, Jan 13, 2012 at 11:47 AM,  labwor...@gmail.com wrote:
  Warning: *default-encoding* not declared dynamic and thus is not
 dynamically
  rebindable, but its name suggests otherwise. Please either indicate

 More indirectly, stop using clojure-contrib and move to
 http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go .
 In the selected example, duck-streams was replaced with the included
 clojure.java.io in Clojure 1.2.

 --
 Stephen Compall
 ^aCollection allSatisfy: [:each | aCondition]: less is better than

 --
 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 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

Re: Help! Migrating to 1.3.0

2012-01-14 Thread James Reeves
On 14 January 2012 23:34, myriam abramson labwor...@gmail.com wrote:
 I couldn't find quite the equivalent to read-lines from duck-streams. I
 found read-line but it's not the same. Where is the equivalent read-lines
 outside of clojure.contrib?

There's clojure.core/line-seq, but it doesn't close the reader when
the seq finishes.

- James

-- 
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


Help! Migrating to 1.3.0

2012-01-13 Thread labwork07
I have a few issues. What do the following warnings mean and what should I  
do about them?


user= (require 'mypackage)
Warning: *default-encoding* not declared dynamic and thus is not  
dynamically rebindable, but its name suggests otherwise. Please either  
indicate ^:dynamic *default-encoding* or change the name.
Warning: *buffer-size* not declared dynamic and thus is not dynamically  
rebindable, but its name suggests otherwise. Please either indicate  
^:dynamic *buffer-size* or change the name.
Warning: *byte-array-type* not declared dynamic and thus is not dynamically  
rebindable, but its name suggests otherwise. Please either indicate  
^:dynamic *byte-array-type* or change the name.
Warning: *append-to-writer* not declared dynamic and thus is not  
dynamically rebindable, but its name suggests otherwise. Please either  
indicate ^:dynamic *append-to-writer* or change the name.

nil

--
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

Re: Help! Migrating to 1.3.0

2012-01-13 Thread vitalyper
Have seen this as well. For efficiency sake 1.3.0 requires :dynamic
meta for convention based ear-muffed vars (intended for rebinding).
The warning actually is quite descriptive if you think about it.
See more in-depth discussion at
http://blog.japila.pl/2011/03/cant-dynamically-bind-non-dynamic-var-in-clojure-1-3/

HTH

On Jan 13, 11:47 am, labwor...@gmail.com wrote:
 I have a few issues. What do the following warnings mean and what should I
 do about them?

 user= (require 'mypackage)
 Warning: *default-encoding* not declared dynamic and thus is not
 dynamically rebindable, but its name suggests otherwise. Please either
 indicate ^:dynamic *default-encoding* or change the name.
 Warning: *buffer-size* not declared dynamic and thus is not dynamically
 rebindable, but its name suggests otherwise. Please either indicate
 ^:dynamic *buffer-size* or change the name.
 Warning: *byte-array-type* not declared dynamic and thus is not dynamically
 rebindable, but its name suggests otherwise. Please either indicate
 ^:dynamic *byte-array-type* or change the name.
 Warning: *append-to-writer* not declared dynamic and thus is not
 dynamically rebindable, but its name suggests otherwise. Please either
 indicate ^:dynamic *append-to-writer* or change the name.
 nil

-- 
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


Re: Help! Migrating to 1.3.0

2012-01-13 Thread Ben Smith-Mannschott
On Fri, Jan 13, 2012 at 17:47,  labwor...@gmail.com wrote:
 I have a few issues. What do the following warnings mean and what should I
 do about them?

Did you read them?

*default-encoding* not declared dynamic and thus is not dynamically rebindable

;; wont' work:
(binding [*default-encoding* some-value]
  (do-something-that-uses *default-encoding*))

but it's name suggests otherwise

*ear-muffs* are lisp convention for dynamically bindable
global variable names. Using that convention is misleading
if the variable isn't actually dynamically bindable.

Please either indicate ^:dynamic *buffer-size*

(def ^:dynamic *buffer-size ...)

Starting with Clojure 1.3, you need to declare when a variable should
be dynamically bindable. This is because performance is better for
vars that are not dynamically bindable, so you are encouraged to use
^:dynamic only where it's actually needed.

or change the name.

If you're not (binding [...]) the var in question rename it.

// Ben

-- 
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


Re: Help! Migrating to 1.3.0

2012-01-13 Thread Softaddicts
Add meta data in your definitions as in

(def ^{:dynamic true} *earmuff* 

Luc


 I have a few issues. What do the following warnings mean and what should I  
 do about them?
 
 user= (require 'mypackage)
 Warning: *default-encoding* not declared dynamic and thus is not  
 dynamically rebindable, but its name suggests otherwise. Please either  
 indicate ^:dynamic *default-encoding* or change the name.
 Warning: *buffer-size* not declared dynamic and thus is not dynamically  
 rebindable, but its name suggests otherwise. Please either indicate  
 ^:dynamic *buffer-size* or change the name.
 Warning: *byte-array-type* not declared dynamic and thus is not dynamically  
 rebindable, but its name suggests otherwise. Please either indicate  
 ^:dynamic *byte-array-type* or change the name.
 Warning: *append-to-writer* not declared dynamic and thus is not  
 dynamically rebindable, but its name suggests otherwise. Please either  
 indicate ^:dynamic *append-to-writer* or change the name.
 nil
 
 -- 
 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
--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail!

-- 
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


Re: Help! Migrating to 1.3.0

2012-01-13 Thread Stephen Compall
On Fri, Jan 13, 2012 at 11:47 AM,  labwor...@gmail.com wrote:
 Warning: *default-encoding* not declared dynamic and thus is not dynamically
 rebindable, but its name suggests otherwise. Please either indicate

More indirectly, stop using clojure-contrib and move to
http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go .
In the selected example, duck-streams was replaced with the included
clojure.java.io in Clojure 1.2.

-- 
Stephen Compall
^aCollection allSatisfy: [:each | aCondition]: less is better than

-- 
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