Fun With Cool

funny code fragments found in *ool documentation and source

How to put a string into a map

Found in the Cool documentation:


stringstream s;
s << "Object " << index;
payload["S"].setValue( s.str() );

How to get a type name from an AttributeList specification

Found in the PyCool examples:


spec.__getattribute__('[]')('i').type_name()


J.Hrivnac, Nov'05