Tcl Source Code

View Ticket
Login
Ticket UUID: 654893
Title: Dictionary (TIP#111) Implementation
Type: Patch Version: None
Submitter: dkf Created on: 2002-12-16 22:49:38
Subsystem: 15. Dict Object Assigned To: dkf
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-04-05 09:17:16
Resolution: Accepted Closed By: dkf
    Closed on: 2003-04-05 02:17:16
Description:
This patch is for gathering together alterations
required to create the new [dict] command and object type.
User Comments: dkf added on 2003-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.)

dgp added on 2003-04-04 03:37:08:
Logged In: YES 
user_id=80530

sorry about the typo.

The current name is "hashDictionary"

dgp added on 2003-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?

dgp added on 2003-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.

dkf added on 2003-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.

dkf added on 2003-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)

dkf added on 2003-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...

dkf added on 2003-02-17 21:01:38:

File Added - 42670: tclDictObj.c

dkf added on 2003-02-17 21:01:02:

File Added - 42669: dict.test

dkf added on 2003-02-17 21:00:26:

File Added - 42668: dict.patch

dkf added on 2003-02-17 20:59:17:

File Deleted - 38205:

dkf added on 2002-12-25 02:33:37:

File Deleted - 37748:

dkf added on 2002-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...

dkf added on 2002-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...

Attachments: