This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Sockets tapset and script


On Tuesday, November 21, 2006 1:27 PM, David Smith wrote:
> Hmm, perhaps we need a bugzilla asking to support array
> initialization, perhaps like this:
>      global xyz = { 1, 5, 10, 15 }
>      global abc = { "zero", "one", "two", "three", "four" }

Remember that these are really associative arrays (à la maps in C++ STL, hashes in Perl, dictionaries in Python, etc.).  So while your example implies a zero-based integer key, that's not necessarily the case.

We could treat it that missing keys are implied to count from zero, and then provide a syntax for specifying keys explicitly as well.
	global sig_num_to_name = { 1:"SIGHUP", 2:"SIGINT", ...}
	global sig_name_to_num = { "SIGHUP":1, "SIGINT":2, ...}
	global times_table = { [1,2]:2, [5,6]:30, ...}


Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]