[CLJ-291] (take-nth 0 coll) redux... Created: 08/Apr/10 Updated: 10/Dec/10 |
|
| Status: | In Progress |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Approved Backlog |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Assembla Importer | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Approval: | Incomplete |
| Description |
|
I dont seem to be able make the old ticket uninvalid so here goes (let [j 0 I used jvisualvm and the jvm is doing some RNI call - no clojure code is running at all |
| Comments |
| Comment by Assembla Importer [ 17/Oct/10 9:47 AM ] |
|
Converted from http://www.assembla.com/spaces/clojure/tickets/291 |
| Comment by Assembla Importer [ 17/Oct/10 9:47 AM ] |
|
bhurt said: Before this bug gets marked as invalid as well, let me point out that the problem here is that (take-nth 0 any-list) is a meaningless construction- the only question is what to do when this happens. IMHO, the correct behavior is to throw an exception. |
| Comment by Assembla Importer [ 17/Oct/10 9:47 AM ] |
|
ataggart said: [file:dfNhoS2Cir3543eJe5cbLA]: throws IllegalArgumentException on negative step size |
| Comment by Stuart Halloway [ 29/Oct/10 10:36 AM ] |
|
Does calling (take-nth 0 ...) cause the problem, or only realizing the result? |
| Comment by Chouser [ 29/Oct/10 11:06 AM ] |
|
I'm not seeing a problem. Calling take-nth and even partially consuming the seq it returns works fine for me: (take 5 (take-nth 0 [1 2 3])) Note however that it is returning an infinite lazy seq. The example in the issue description seems to include essentially (doall <infinite-lazy-seq>) which does blow the heap: (doall (range)) This issue still strikes me as invalid. |
| Comment by Rich Hickey [ 29/Oct/10 11:06 AM ] |
|
(take-nth 0 ...) returns an infinite sequence of the first item: (take 12 (take-nth 0 [1 2 3])) Is something other than this happening on Solaris? |