Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-07-29
19:40 • Ticket [693836ffff] TIP#127 implementation status still Closed with 4 other ... artifact: bb36fc8b48 user: dkf
2008-11-02
18:26 • Ticket [693836ffff]: 7 changes artifact: f46e7b465d user: dkf
2003-10-15
05:49 • Ticket [693836ffff]: 4 changes artifact: a880b06811 user: dkf
05:43 • Ticket [693836ffff]: 4 changes artifact: 14626f91e1 user: dgp
2003-10-14
20:39 • Closed ticket [693836ffff]. artifact: a512b796c0 user: dkf
2003-10-13
15:28 • Ticket [693836ffff]: 1 change artifact: f254689dba user: dkf
15:27 • Ticket [693836ffff]: 4 changes artifact: 8f8e549725 user: dkf
01:54 • Ticket [693836ffff]: 4 changes artifact: b2c16d8271 user: mic42
01:47 • Ticket [693836ffff]: 4 changes artifact: 35b4ff0f84 user: mic42
01:47 • Add attachment CmdIL.test.diff to ticket [693836ffff] artifact: 81e9429083 user: mic42
01:47 • Ticket [693836ffff] TIP#127 implementation status still Open with 4 other ch... artifact: 4948d03b89 user: mic42
01:47 • Add attachment lsearch.test.diff to ticket [693836ffffffffff|693836ffff... artifact: 38ca1bdb8f user: mic42
01:46 • Add attachment tclCmdIL.c.diff to ticket [693836ffff] artifact: 75e5c767cb user: mic42
01:46 • Ticket [693836ffff] TIP#127 implementation status still Open with 4 other ch... artifact: 1455fcc890 user: mic42
2003-10-01
19:22 • Ticket [693836ffff]: 4 changes artifact: 224173aab7 user: dkf
2003-09-13
22:24 • Ticket [693836ffff]: 4 changes artifact: 7404ed70cf user: mic42
08:08 • Ticket [693836ffff]: 4 changes artifact: 58689fd59c user: dkf
2003-09-12
20:19 • Ticket [693836ffff]: 1 change artifact: b09b28a410 user: dkf
20:18 • Ticket [693836ffff]: 2 changes artifact: 0f5973762c user: dkf
2003-03-01
23:10 • Ticket [693836ffff]: 4 changes artifact: f96551ea54 user: mic42
21:28 • Ticket [693836ffff]: 4 changes artifact: aa70e0e7c4 user: mic42
2003-02-26
18:53 • New ticket [693836ffff]. artifact: 612761f4c0 user: mic42

TIP#127 implementation

Closed693836ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 17 years ago
Descriptionplain2003-02-26 18:53:18
This patch adds a -index option like the one from lsort
to lsearch.

Its diff'ed -u against the current HEAD (rev 1.45)
mic42plain2003-03-01 21:28:21
File Added - 43783: tclCmdIL.c.diff

Logged In: YES 
user_id=302287

Forgot to attach the patch.
mic42plain2003-03-01 23:10:28
File Added - 43786: tclCmdIL.c.diff

Logged In: YES 
user_id=302287

I made a new patch, further enhancing lsearch (and lsort as
a side effect).

The new patch does the following:

add two new options to lsearch:
-index index 
-subindices

-subindices is mutually exclusive with -inline and may only
be specified if -index is specified.
-----
?-index index?

Takes an index in the form used by lindex or lset, a list of
indices is allowed to search or sort based on the values in
nested sublists.

?-subindices? 

Returns indices one can use directly in [lset] or [lindex]
to access the sublist element found.

----
dkf Ticket [693836ffff]: 2 changes [History diff]2003-09-12 20:18:56
dkf Ticket [693836ffff]: 1 change [History diff]2003-09-12 20:19:30
dkfplain2003-09-13 08:08:41
File Deleted - 43783: 

Logged In: YES 
user_id=79902

Could you be a real star and produce:
  * a forward patch (the one you've done is reversed!)
  * some tests (via a patch to lsearch.test of course)
While I could reverse the patch, synthesizing tests is a bit
awkward as I don't understand (especially at 2am!) the
nuances of what cases should be tested and how.  (You could
use some of the examples from the TIP as the basis...)

If there are a few tests in there (so we can check that it
is doing what we think it ought to be doing) I'd be happy to
get this code into the core.
mic42plain2003-09-13 22:24:37
Logged In: YES 
user_id=302287

Sorry for the reversed patch. Should do better this time.
Shall i diff against current HEAD? 

As the patch changes things to lsearch and lsort tests for
both will be needed. I have the ones for simple syntax
checks (where the error messages are checked) done, as those
are trivial. 

Just a bit busy this week (local conference), so expect
something by the end of the week/next weekend.

Michael
dkfplain2003-10-01 19:22:37
Logged In: YES 
user_id=79902

Reminder: still waiting the tests (or at least enough of them 
that I can double-check that the behaviour specified in the 
TIP is actually implemented)
mic42plain2003-10-13 01:46:30
File Added - 64143: tclCmdIL.c.diff
mic42plain2003-10-13 01:47:20
File Deleted - 43786: 



File Added - 64144: lsearch.test.diff
mic42plain2003-10-13 01:47:53
File Added - 64145: CmdIL.test.diff
mic42plain2003-10-13 01:54:33
Logged In: YES 
user_id=302287

Ok, hopefully i have done the diff'ing the right way this time.

I added a basic testsuite, i wouldn't say its really
complete, there should probably be more checks.
(as the multiindex code is shared between lsort and lsearch
there are more tests in lsearch that test it).

Whats missing:
more combinations of options
(-inline...)  
Really good tests for error handling of the index code
(should have copied some things from the lset and lindex
tests..., as the code is copied from lindex...), some basic
ones are there.

A patch to the documentation.
dkfplain2003-10-13 15:27:44
Logged In: YES 
user_id=79902

Thanks. I'll try to get this in when I can.
dkf Ticket [693836ffff]: 1 change [History diff]2003-10-13 15:28:40
dkfplain2003-10-14 20:39:58
Logged In: YES 
user_id=79902

Applied to HEAD.  The documentation is perhaps a touch 
sparse, but that can be the subject of future bug reports if 
I've omitted something crucial.  :^)
dgpplain2003-10-15 05:43:18
Logged In: YES 
user_id=80530


Note this implementation
causes new segfaults.
Test cmdIL-5.5 demos this.

Probably good learning
opportunities here for how
apparently good code can be
subtly wrong.
dkfplain2003-10-15 05:49:49
Logged In: YES 
user_id=79902

That issue is being tracked in Bug 823768
dkfplain2008-11-02 18:26:31
data_type - 210894
dkfplain2009-07-29 19:40:09
IP - Comment Removed: 130.88.1.31
Log in (anonymous is fine) to add a comment.

Attachments: