Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2025-06-18
08:15 • Ticket [04ac7a9d9f] lsearch shimmers abstract lists status still Open with 5... artifact: e185bb1e18 user: oehhar
07:54 • Ticket [04ac7a9d9f]: 3 changes artifact: c8c26c2bbf user: apnadkarni
06:30 • Ticket [04ac7a9d9f]: 4 changes artifact: fcd1e4db4a user: oehhar
05:54 • Ticket [04ac7a9d9f]: 3 changes artifact: 3702691a27 user: apnadkarni
05:54 • New ticket [04ac7a9d9f]. artifact: 0bd6cded45 user: apnadkarni

lsearch shimmers abstract lists

Open04ac7a9d9f82b622903efb69f2cdfb78ead81ba9Created 1 year agoUpdated 1 year ago
Descriptionmarkdown2025-06-18 05:54:17

lsearch shimmers abstract lists that do not themselves implement lsearch functionality. For example,

% set l [lrepeat 200 x]; 'rep $l
value is a repeatedList with a refcount of 3, object pointer at 0x1a7c5144f30, internal representation 0x1a7c512e0c0:0xc8, no string representation
% lsearch $l x
0
% 'rep $l
value is a list with a refcount of 3, object pointer at 0x1a7c5144f30, internal representation 0x1a7c69abea0:0x0, no string representation

Either lsearch should be modified to use Tcl_ListObjIndex for abstract lists or abstract lists in the core should implement lsearch themselves (or both). Note lseq already implements lsearch.

apnadkarni Ticket [04ac7a9d9f]: 3 changes [History diff]2025-06-18 05:54:43
oehharwiki2025-06-18 06:30:34

Ashok, thanks for the ticket.

Here is my tcl 9.0.1 session:

% set l [lrepeat 200 x]; ::tcl::unsupported::representation $l
value is a list with a refcount of 2, object pointer at 0x171023e8b20, internal representation 0x17102b66940:0x0, no string representation
% lsearch $l x
0
4 % ::tcl::unsupported::representation $l
value is a list with a refcount of 2, object pointer at 0x171023e8b20, internal representation 0x17102b66940:0x0, no string representation

It was a list and still is a list. What is the supposed output?

For me, shimmering is the change of the type which did not happen? This is probably obvious, but I don't see it...

Thanks, Harald

apnadkarnimarkdown2025-06-18 07:54:04

Oops. Pasted the output from the wrong window. Should have been

% set l [lrepeat 200 x]; 'rep $l
value is a repeatedList with a refcount of 3, object pointer at 0x1a7c5144f30, internal representation 0x1a7c512e0c0:0xc8, no string representation
% lsearch $l x
0
% 'rep $l
value is a list with a refcount of 3, object pointer at 0x1a7c5144f30, internal representation 0x1a7c69abea0:0x0, no string representation

Note this is for 9.1, and does not apply to 9.0.x as those do not have the relevant abstract lists anyways.

oehharwiki2025-06-18 08:15:48

Ok, thanks. I have modified the original ticket to make it clearer. Now, it makes sense.

Thanks, Harald

Log in (anonymous is fine) to add a comment.