Interesting map results

Interesting map results

I've been playing around with a map variable, just to characterize how maps work. I want to return a map from a function so several pieces of information can be used by the calling code. Here is what I have tried:

map com.testFunction()
{
    testMap = map();
    testMap.put("str", "String");
    testMap.put("num", 123);
    testMap.put("bool", true);
    //
    info isText(testMap.get("str"));
    info isNumber(testMap.get("num"));
    info  isText(testMap.get("bool")) ;
    info if(testMap.get("bool") == "true", "Is True", "Is False"); // Mimics a boolean by using "true" in place of true.
    // 
    // This commented statement yields an error when uncommented, showing the value is not a boolean..
    // info if(testMap.get("bool") == true, "Is True", "Is False"); // Test for a boolean result of true
    // Error at line number : 10 at column 120 
    // In Criteria left expression is of type STRING and right expression is of type BOOLEAN and the operator == is not  valid
    //
    return testMap;
}

Ultimately I would like to store a "resCode" which would contain a boolean (indicates that the function returns a valid value or not), resMsg, a text string to further describe a failure, and a key/value, which is the primary result. I get these results when I execute this function:

Executed Successfully
Return Value:
{str=String, bool=true, num=123}
Log messages:
true
true
true
Is True

A couple things stand out. 1) I can enter a number that the isNumber() function validates as a number. 2) In trying to include a boolean as a key/value entering  testMap.put("bool", true); yields a text value rather than a boolean. It's not a boolean, which I understand is not supported in a map value. What's unexpected is that it seems to accept it as a text string without using quotes to define the string.

From my reading in this forum, map values are stored as strings, or I'm kind of surprised at these results. Can anyone explain why this is so? At this point, I'm just exploring what I can find out about the internals of map functionality.