Overview
| Artifact ID: | 22dff9fb0dc372508c01f8e7126bf17e697587a4 |
|---|---|
| Ticket: | 217867ffffffffffffffffffffffffffffffffff
concat support for list objects |
| User & Date: | nobody on 2000-10-26 00:45:06 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 2098 RFE Version: 8.1 SubmitDate: '1999-05-19' LastModified: '1999-08-06' Severity: LOW Status: Closed Submitter: pat ChangedBy: hobbs RelatedBugIDs: 2101 2257 OS: Solaris OSVersion: 2.5.1 Machine: Other FixedDate: '2000-10-25' ClosedDate: '1999-08-06' Name: Jeffrey Hobbs CVS: May 17, tclUtil.c $Id: tclUtil.c,v 1.11 1999/05/06 19:21:11 stanton Exp $ CustomShell: mod core? not me... Comments: In tests on larger lists, this actually takes a bit more time to return to assemble and return the object than the regular bytes concat mode. However, when the returned object is next used as a list (like with foreach), there is a notable time savings. Again, this only affects calls to concat where all args passed are already recgonized list objects. This passes all tests, and doesn't break any syntax logic. DesiredBehavior: As pointed out on c.l.tcl, concat actually converts everything to strings and returns a string, as opposed to what the docs say. This features enhancement involves situations where concat was passed only objects of the list type. In this case, it concats them together into one list, and returns an object of type list. Patch: The following needs to be inserted as the first code in Tcl_ConcatObj in tclUtil.c: for (i = 0; i < objc; i++) { if (objv[i]->typePtr != &tclListType) { break; } } if (i == objc) { Tcl_Obj **listv; int listc; /* * All the items are of list type, concat them together * as lists, and return as a list obj */ objPtr = Tcl_NewListObj(0, NULL); for (i = 0; i < objc; i++) { /* * No check is made on the result code, as we checked * above that they are all of list type... */ Tcl_ListObjGetElements(NULL, objv[i], &listc, &listv); Tcl_ListObjReplace(NULL, objPtr, INT_MAX, 0, listc, listv); } return objPtr; } PatchFiles: generic/tclUtil.c - foundin changed to: "obsolete: 8.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "concat support for list objects"
- type changed to: "Bug"