Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Dictionary (TIP#111) Implementation

Closed / Accepted654893ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-12-16 22:49:38
This patch is for gathering together alterations
required to create the new [dict] command and object type.
dkfplain2002-12-17 05:52:53
File Added - 37748: tclDictObj.c

Logged In: YES 
user_id=79902

Here's an (untested) piece of code that implements a
suitable Tcl_Obj and some miscellaneous accessor API
functions.  Much still to do...
dkfplain2002-12-25 02:30:02
File Added - 38205: tclDictObj.c

Logged In: YES 
user_id=79902

All that, plus more comments, plus an implementation of the
[dict] command (pre-TIP state).  More work still needed, but
this is now much closer to being ready for testing...
dkfplain2002-12-25 02:33:37
File Deleted - 37748:
dkfplain2003-02-17 20:59:17
File Deleted - 38205:
dkfplain2003-02-17 21:00:26
File Added - 42668: dict.patch
dkfplain2003-02-17 21:01:02
File Added - 42669: dict.test
dkfplain2003-02-17 21:01:38
File Added - 42670: tclDictObj.c
dkfplain2003-02-17 21:04:37
Logged In: YES 
user_id=79902

OK, here's a working version of the dictionary code.  You
need the patch, the tests and the C file.  Apply the patch
in the normal manner (:^) put tclDictObj.c in generic/, put
dict.test in tests/, and rebuild.  (Windows users will need
to do a bit of work to update their makefile. I unashamedly
develop only on Unix, though the source itself should be
completely portable.)  Still needs documentation...
dkfplain2003-02-17 22:10:01
Logged In: YES 
user_id=79902

Some documentation as part of the TIP itself (since docs 
really form part of the spec, not the impl)
dkfplain2003-03-19 04:00:55
Logged In: YES 
user_id=79902

Just a note in passing (because I can't be bothered to
reupload all the patches): the structure Tcl_DictSearch does
not need an objPtr member, as it is only ever assigned to in
one place and never compared.  Behaviour should be right though.
dgpplain2003-04-03 05:57:31
File Added - 46635: 654893.patch

Logged In: YES 
user_id=80530

here is an updated patch, diff'd
from today's HEAD, including
the new files.

A few bugs fixed here, one on
Dict refcounting, and one that
the [dict] command is safe to
give in safe interps.

Note that on platforms where
TCL_WIDE_INT_IS_LONG is
#define'd, the patch for Tcl
Bug 713562 must also be applied
for this patch to work.

This passes all tests in the dict.test
test suite.  I have not checked
whether that test suite covers/agrees
with TIP 111.
dgpplain2003-04-04 03:35:08
Logged In: YES 
user_id=80530

I see that the new Tcl_ObjType
struct, tclDictType, has the name
field value of "hasDictionary".

Why not use the name "dict"
more in keeping with names of
other Tcl_ObjType's in the core?
dgpplain2003-04-04 03:37:08
Logged In: YES 
user_id=80530

sorry about the typo.

The current name is "hashDictionary"
dgp Ticket [654893ffff]: 1 change [History diff]2003-04-04 04:44:20
dkfplain2003-04-05 09:17:16
Logged In: YES 
user_id=79902

Dictionaries now incorporated into core and under maintenance.  Any future faults should be raised as bugs (as 
normal.)
Log in (anonymous is fine) to add a comment.

Attachments: