English 中文(简体)
How to create data structure in Tcl?
原标题:

I am translating some lisp code to Tcl and wonder if there is anything like lisp s defstruct in Tcl for creating data structures?

If nothing is built into Tcl, what extension packages to Tcl would you recommend that can be used in a commercial application.

Thanks.

-William

最佳回答

Consider using dictionaries, which work more or less like a hashmap. You can set the key/value pairs much like you would any other structure.

问题回答

You could take a look at the pages on Rosetta Code under Data Structures. They all have Tcl examples.

Tcl tutor is having 44-47 lessons on dictionaries.





相关问题
The Fastest DataStructure to Filter with in C#

Currently we are filtering and sorting data with a datatable. /// <summary> /// Filters the data table and returns a new data table with only the filtered rows. /// </summary>...

Efficient queue in Haskell

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: ...

Java large datastructure for storing a matrix

I need to store a 2d matrix containing zip codes and the distance in km between each one of them. My client has an application that calculates the distances which are then stored in an Excel file. ...

Holding onto items after a postback

I have an ASP.NET web application and I want to be able to take items from a master list and store them temporarliy into one of four other lists. The other lists need to survive post backs so that ...

negative number in the stack

I am a new student in the compilers world ^_^ and I want to know is legal represent negative number in the stack. For example: infix: 1-5=-4 postfix: 15- The statements are: push(1) push(5) x=...

What type of struct/container would you use in this instance?

I am trying to figure out what type of structure or container I should use for a quick project. I need to have an unknown number of sets that will be entered from the GUI (each one will have a name, ...

热门标签