That's a first version of the [range] command
working in O(1) space. There is some minor bug I'll fix
tomorrow, but the basic stuff appears to be ok.
commands aware of the new arithSeries object
in the TEBC and normal fashion:
llength
lindex
foreach
New commands:
Only [range]. The change is minimal from
the user point of view. From the core
side is a bit more tricky because of the O(1)
space aims.
Other stuff optimized for this object:
SetListObjFromAny will directly convert ranges
into lists without to pass for the string repr.
Open issues:
The code needs a check in order to
don't allow the generation of ranges
that are longer than the max listObj length
supported by the current Tcl code.
For the rest, I used Wide Ints in order to
ensure that ranges shorter than the max
list length, but having as elements Wide ints
will work.
Performance changes:
The effects on the performances of the list-oriented
should be very small, there is some test more
than before.
The case of:
foreach x [range 0 $n]
is faster than the
equivalent [for] form by 10% to 30% from
a first test.
The appended patch should apply against HEAD.
Alexandre Ferrieux
14. List Object
TIP Implementation
Public
|
Date: 2008-12-07 03:48:00 UTC rPWO2P <a href="http://wtpcvjaxnudh.com/">wtpcvjaxnudh</a>, |
|
Date: 2008-07-30 10:16:20 UTC
|
|
Date: 2004-11-02 00:59:40 UTC Logged In: YES |
|
Date: 2004-10-25 22:00:12 UTC Logged In: YES |
|
Date: 2004-10-25 08:09:06 UTC Logged In: YES |
|
Date: 2004-10-25 08:08:33 UTC Logged In: YES |
|
Date: 2004-10-25 08:08:30 UTC Logged In: YES |
|
Date: 2004-10-25 08:07:59 UTC Logged In: YES |
|
Date: 2004-10-24 19:00:57 UTC Logged In: YES |
|
Date: 2004-10-24 15:13:48 UTC Logged In: YES |
|
Date: 2004-10-24 14:50:05 UTC Logged In: YES |
|
Date: 2004-10-24 13:50:11 UTC Logged In: YES |
|
Date: 2004-10-24 09:34:19 UTC Logged In: YES |
|
Date: 2004-10-24 09:34:16 UTC Logged In: YES |
|
Date: 2004-10-23 19:07:29 UTC Logged In: YES |
|
Date: 2004-10-23 15:27:57 UTC Logged In: YES |
|
Date: 2004-10-23 10:12:57 UTC Logged In: YES |
| Filename | Description | Download |
|---|---|---|
| range.patch | patch version 23Oct2004 | Download |
| range3.patch | 24Oct2004 O(1) range patch. | Download |
| msrange.patch | Download | |
| range5.patch | O(1) [range] command, 25Oct2004 patch. | Download |
| range.test.tcl | test for [range], [foreach], [lindex], [llength], arithSeriesObject-wise tests. | Download |
| range6.patch | patch version 6, 25/Oct/2004. | Download |
| range.n | range command manual page | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| assigned_to | msofer | 2008-07-30 00:02:19 UTC | msofer |
| File Added | 107307: range.n | 2004-11-02 01:00:15 UTC | antirez |
| summary | O(1) space [range] command. | 2004-10-25 22:02:46 UTC | antirez |
| File Added | 106451: range6.patch | 2004-10-25 22:00:13 UTC | antirez |
| summary | TIP#225: O(1) space [range] command. | 2004-10-25 22:00:12 UTC | antirez |
| summary | O(1) space [range] command. | 2004-10-25 10:32:58 UTC | dkf |
| File Added | 106350: range.test.tcl | 2004-10-25 08:09:06 UTC | antirez |
| File Added | 106349: range5.patch | 2004-10-25 08:07:59 UTC | antirez |
| File Added | 106266: msrange.patch | 2004-10-24 13:50:11 UTC | msofer |
| File Deleted | 106185: | 2004-10-24 09:34:46 UTC | antirez |
| File Added | 106250: range3.patch | 2004-10-24 09:34:19 UTC | antirez |
| File Added | 106185: range2.patch | 2004-10-23 19:07:29 UTC | antirez |
| assigned_to | nijtmans | 2004-10-23 10:12:57 UTC | msofer |
| File Added | 106124: range.patch | 2004-10-23 01:22:34 UTC | antirez |