| Anonymous | Login | Signup for a new account | 2013-05-22 23:23 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004079 | OCaml | OCaml standard library | public | 2006-08-07 15:58 | 2012-09-11 17:00 | ||||||
| Reporter | Christophe | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.09.2 | ||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0004079: Queue.copy is not tail recursive ! | ||||||||||
| Description | Queue.copy is not tail recursive. Hence, large queue can not be safely duplicated. This would be very simple to make it tail-recursive. I propose here a solution ; let copy q = if q.length = 0 then create() else let tail = q.tail in let rec tail' = { content = tail.content; next = tail' } in let rec copy prev cell = if cell != tail then let res = { content = cell.content; next = tail' } in prev.next <- res; copy res cell.next in copy tail' tail.next; { length = q.length; tail = tail' } | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2006-08-07 15:58 | Christophe | New Issue | |
| 2006-08-29 16:41 | doligez | Status | new => acknowledged |
| 2012-07-11 16:41 | doligez | Target Version | => 4.01.0+dev |
| 2012-07-29 17:57 | frisch | Category | OCaml general => OCaml standard library |
| 2012-07-31 13:37 | doligez | Target Version | 4.01.0+dev => 4.00.1+dev |
| 2012-09-11 17:00 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |