Re: syntax for dict
- From: George Peter Staplin <georgeps@xxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 10:55:51 +0000 (UTC)
on slebetman@xxxxxxxxx wrote:
George Peter Staplin wrote:
I'm rather fond of my own implementation that already works, and
supports features that dict doesn't, such as traces, key locking, key
creation locking, and whole structure locking, and probably some others.
$ tclsh8.4
% load ./structure.so
% set s [structure]
structure0
% $s
wrong # args: should be "structure0 ?key? | key value ?key value? ..."
% $s key value
% puts [$s key]
value
% trace.structure.key $s key {puts CHANGED}
% $s key value2
CHANGED
$s can be passed to another procedure and reused quite easily.
Oh wow, that's nice. I see that structures are created is a similar
manner to file channels, sockets and canvas items. So it feels familiar
and quite 'Tcl'ish. But how do you do nested [structure]?
Thanks. It doesn't have any explicit support for nested structures,
yet.
Have you tried compiling on other platforms? Where can I find your
extension?
I've compiled the extension in NetBSD, Linux, and Windows (with MinGW
IIRC).
The latest version of the structure code is here:
http://www.xmission.com/~georgeps/implementation/software/megapkg/megapkg-361.tar.bz2
The actual C code is in megapkg-361/csrc/structure/*.c
The tests for the extension are in megapkg-361/tclsrc/generic.img and
megapkg-361/tclsrc/tests/structure.tcl (the frontend).
To build structure.so in Windows with MinGW you'll need to do something
like this (after setting the build.conf paths):
tclsh8.4.exe build.tcl build.conf structure.so
Otherwise build.tcl would attempt to build every extension and binary in
megapkg, and unfortunately some of them target unix, and would thus
fail.
I seem to recall I did something with a dllwrap or dlltool manually when
I built it in Windows XP years ago. Patches to the build.tcl or
tickmakefile for Windows-specific builds would be appreciated. :)
George
.
- References:
- syntax for dict
- From: Salvatore Sanfilippo
- Re: syntax for dict
- From: George Peter Staplin
- Re: syntax for dict
- From: slebetman@xxxxxxxxx
- syntax for dict
- Prev by Date: Re: Finding packages
- Next by Date: tk::Text... documentation
- Previous by thread: Re: syntax for dict
- Next by thread: Re: syntax for dict
- Index(es):
Relevant Pages
|