Re: syntax for dict



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
.



Relevant Pages

  • Re: mkmf-bug under mingw without msys
    ... I have a problem building an extension with mkmf under windows which ... seems to me as a bug: I want to build the extension in an mingw ... it's transparent usage under Ruby for Windows: ...
    (comp.lang.ruby)
  • ~~~~~~~~~~~~~~ FILE NAME ~~~~~~~~~~~~~~
    ... adapter description file file name extension ... apple script to change file names ... batching file name changes in windows ... change short file names in dos ...
    (sci.misc)
  • Re: Windows Explorer exits unexpectedly Windows XP Pro
    ... another FYI - I did the same thing on our windows 2000 and 2003 ... This gz extensiion is a unix extension from the ... for this on XP Pro. ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: 2nd form with recordset of 1st
    ... processes using this table using optimistic locking? ... If this is a split database, is there a persistent connection to the back ... Every directory traversed requires Windows to ... > record source to be the 1st forms recordset? ...
    (microsoft.public.access.formscoding)
  • Re: Shell Image View Control in System32
    ... How To Update Video Driver ... the "Choose Program" applet still will not display ... While still in Windows Explorer, ... Scroll down the list on the right and see of there is a file extension ...
    (microsoft.public.windows.inetexplorer.ie6.browser)