1
0
Fork 0

add values() function as a counterpiece to keys() (see Perl)

This commit is contained in:
mfranz 2009-02-15 14:13:49 +00:00
parent 58d629ed13
commit 8f5304ad90

View file

@ -12,7 +12,7 @@ var M2NM = 1 / NM2M;
var KT2MPS = 0.5144444444; # knots to m/s
var MPS2KT = 1 / KT2MPS;
var LB2KG = 0.45359237; # pounds to kilogram
var LB2KG = 0.45359237; # pounds to kg
var KG2LB = 1 / LB2KG;
var GAL2L = 3.785411784; # US gallons to liter
@ -133,6 +133,16 @@ var thisfunc = func caller(1)[1];
var printf = func print(call(sprintf, arg));
##
# Returns vector of hash values.
#
var values = func(hash) {
var vec = [];
foreach(var key; keys(hash)) append(vec, hash[key]);
return vec;
}
##
# Print log messages in appropriate --log-level.
# Usage: printlog("warn", "...");