Overview
| Artifact ID: | fb61a56b2d8a4edbfb4b380972402400f4be1363 |
|---|---|
| Ticket: | 1052584fffffffffffffffffffffffffffffffff
TIP#225: O(1) space [range] command. |
| User & Date: | antirez on 2004-10-25 15:07:59 |
Changes
- icomment:
File Added - 106349: range5.patch Logged In: YES user_id=67765 New patch attached (range5.patch). The idea is to merge what I think are the best points of Miguel's and my patch, there are also random bugfixes. Description of the current structure: - The arithSeries object is a standalone object, there is no code about it in the List object metod, but setListFromAny knows how to convert an airthmetic sequence to a list without to pass for the string repr. - The commands lindex, llength and foreach knows about the arithmetic series object in order to avoid to convert into a list. - Like in the Miguel's patch, there is no longer a reference to a wide object inside the range, this was possible modifing the code in TEBC using the Miguel's implementation idea. - Like in Miguel's patch now there is a flag in the arithmetic sequence object that tells us if every element of the range can fit or not in an Int, or if it requires a Wide. So where possible the Int objects are used in place to Wide ones. - The patch was updated to reflect the new core changes just commited by Miguel. Instead of five ad-hoc checks to see if it's possible to update a variable directly without to pass for the usual API, there is now a function to test for this condition in a very clean way. - Ranges with negative step are now fixed. In general the algorithm that computes the length of the list is now better and should be definitive at this point. - There is now a test for the [range] command, and for [foreach], [lindex], [llength] in relation to the new obj type. Not in the patch, but attached as a different file here. Should be all for now.
- login: "antirez"
- mimetype: "text/plain"
- username: "antirez"