add values() function as a counterpiece to keys() (see Perl)
This commit is contained in:
parent
58d629ed13
commit
8f5304ad90
1 changed files with 11 additions and 1 deletions
|
@ -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", "...");
|
||||
|
|
Loading…
Add table
Reference in a new issue