Index: cpp/frams/vm/classes/collectionobj.cpp
===================================================================
--- cpp/frams/vm/classes/collectionobj.cpp	(revision 394)
+++ cpp/frams/vm/classes/collectionobj.cpp	(revision 409)
@@ -17,23 +17,28 @@
 {"Vector",1,13,"Vector","Vector is a 1-dimensional array indexed by an integer value (starting from 0). "
  "Multidimensional arrays can be simulated by putting other Vector objects into a Vector.\n"
- "Examples:\n"
- "var v1=Vector.new(); v1.add(123); v1.add(\"string\");\n"
- "var v2=[123,\"string\"]; //a short way of doing the same (square brackets create a vector)\n"
- "var v3=[[1,2,3],[4,5],[6]]; //simulate a 2D array\n"
- "for(var element in v3) Simulator.print(element); //Vector supports enumeration"
+"Examples:\n"
+"\tvar v1=Vector.new();\n"
+"\tv1.add(123);\n"
+"\tv1.add(\"string\");\n"
+"A short way of doing the same (square brackets create a vector):\n"
+"\tvar v2=[123,\"string\"];\n"
+"Simulate a 2D array:\n"
+"\tvar v3=[[1,2,3],[4,5],[6]];\n"
+"You can iterate directly over values of a Vector using for(...in...) loops:\n"
+"\tfor(var element in v3) Simulator.print(element);"
 },
-{"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),},
-{"size",0,PARAM_READONLY | PARAM_NOSTATIC,"element count","d",GETONLY(size),},
-{"remove",0,PARAM_NOSTATIC,"remove at position","p(d position)",PROCEDURE(p_remove),},
-{"get",0,PARAM_NOSTATIC,"get value at position","p x(d position)",PROCEDURE(p_get),"object[position] can be always used instead of object.get(position)"},
-{"set",0,PARAM_NOSTATIC,"set value at position","p(d position,x value)",PROCEDURE(p_set),"object[position]=value can be always used instead of object.set(position,value)"},
-{"add",0,PARAM_NOSTATIC,"append at the end","p(x value)",PROCEDURE(p_add),},
-{"find",0,PARAM_NOSTATIC,"find","p d(x value)",PROCEDURE(p_find),"returns the element index or -1 if not found"},
-{"avg",0,PARAM_READONLY | PARAM_NOSTATIC,"average","f",GETONLY(avg)},
-{"stdev",0,PARAM_READONLY | PARAM_NOSTATIC,"standard deviation","f",GETONLY(stdev),"=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev."},
-{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"textual form","s",GETONLY(toString),},
-{"new",0,0,"create new Vector","p oVector()",STATICPROCEDURE(p_new),},
-{"sort",0,PARAM_NOSTATIC,"sort elements (in place)","p(o comparator)",PROCEDURE(p_sort),"comparator can be null, giving the \"natural\" sorting order (depending on element type), otherwise it must be a function reference obtained by the \"function FUNCTIONNAME\" operator.\n\nExample:\nfunction compareLastDigit(a,b) {return (a%10)<(b%10);}\nvar v=[16,23,35,42,54,61];\nv.sort(function compareLastDigit);"},
-{"iterator",0,PARAM_NOSTATIC | PARAM_READONLY,"iterator","o",GETONLY(iterator),},
+{"clear",0,PARAM_NOSTATIC,"Clear data","p()",PROCEDURE(p_clear),},
+{"size",0,PARAM_READONLY | PARAM_NOSTATIC,"Element count","d",GETONLY(size),},
+{"remove",0,PARAM_NOSTATIC,"Remove at position","p(d position)",PROCEDURE(p_remove),},
+{"get",0,PARAM_NOSTATIC,"Get value at position","p x(d position)",PROCEDURE(p_get),"object[position] can be always used instead of object.get(position)"},
+{"set",0,PARAM_NOSTATIC,"Set value at position","p(d position,x value)",PROCEDURE(p_set),"object[position]=value can be always used instead of object.set(position,value)"},
+{"add",0,PARAM_NOSTATIC,"Append at the end","p(x value)",PROCEDURE(p_add),},
+{"find",0,PARAM_NOSTATIC,"Find","p d(x value)",PROCEDURE(p_find),"returns the element index or -1 if not found"},
+{"avg",0,PARAM_READONLY | PARAM_NOSTATIC,"Average","f",GETONLY(avg)},
+{"stdev",0,PARAM_READONLY | PARAM_NOSTATIC,"Standard deviation","f",GETONLY(stdev),"=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev."},
+{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"Textual form","s",GETONLY(toString),},
+{"new",0,0,"Create new Vector","p oVector()",STATICPROCEDURE(p_new),},
+{"sort",0,PARAM_NOSTATIC,"Sort elements (in place)","p(o comparator)",PROCEDURE(p_sort),"comparator can be null, giving the \"natural\" sorting order (depending on element type), otherwise it must be a function reference obtained by the \"function FUNCTIONNAME\" operator.\n\nExample:\nfunction compareLastDigit(a,b) {return (a%10)<(b%10);}\nvar v=[16,23,35,42,54,61];\nv.sort(function compareLastDigit);"},
+{"iterator",0,PARAM_NOSTATIC | PARAM_READONLY,"Iterator","o",GETONLY(iterator),},
 {0,0,0,},
 };
@@ -44,18 +49,29 @@
 {
 {"Dictionary",1,9,"Dictionary","Dictionary associates stored values with string keys "
- "(\"key\" is the first argument in get/set/remove functions). Integer \"key\" can be "
+ "(\"key\" is the first argument in get/set/remove functions). Integer key can be "
  "used to enumerate all elements (note that while iterating, the elements are returned in no particular order).\n"
- "Examples:\nvar d1=Dictionary.new(); d1.set(\"name\",\"John\"); d1.set(\"age\",44);\n"
- "var d2=Dictionary.new(); d2[\"name\"]=\"John\"; d2[\"age\"]=44; //shorthand notation equivalent to the line above\n"
- "var i;\nfor(i=0;i<d.size;i++) Simulator.print(d.getKey(i)+\" is \"+d.get(i));",},
-{"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),},
-{"size",0,PARAM_NOSTATIC | PARAM_READONLY,"element count","d",GETONLY(size),},
-{"remove",0,PARAM_NOSTATIC,"remove named or indexed element","p(x key)",PROCEDURE(p_remove),},
-{"get",0,PARAM_NOSTATIC,"get named or indexed element","p x(x key)",PROCEDURE(p_get),"object[position] can be always used instead of object.get(position)"},
-{"getKey",0,PARAM_NOSTATIC,"get a key of the indexed element","p s(d index)",PROCEDURE(p_getKey),},
-{"set",0,PARAM_NOSTATIC,"set named or indexed element","p(x key,x value)",PROCEDURE(p_set),"object[key]=value can be always used instead of object.set(key,value)"},
-{"find",0,PARAM_NOSTATIC,"find","p s(x value)",PROCEDURE(p_find),"returns the element key or null if not found"},
-{"new",0,0,"create new Dictionary","p oDictionary()",STATICPROCEDURE(p_new),},
-{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"textual form","s",GETONLY(toString),},
+ "Examples:\n"
+ "\tvar d;\n"
+ "\td=Dictionary.new();\n"
+ "\td.set(\"name\",\"John\");\n"
+ "\td.set(\"age\",44);\n"
+ "Another way of doing the same:\n"
+ "\td={};\n"
+ "\td[\"name\"]=\"John\";\n"
+ "\td[\"age\"]=44;\n"
+ "And the most concise way:\n"
+ "\td={ \"name\":\"John\", \"age\":44 };\n"
+ "Iterating:\n"
+ "\tfor(var i=0;i<d.size;i++) Simulator.print(d.getKey(i)+\" is \"+d.get(i));",
+},
+{"clear",0,PARAM_NOSTATIC,"Clear data","p()",PROCEDURE(p_clear),},
+{"size",0,PARAM_NOSTATIC | PARAM_READONLY,"Element count","d",GETONLY(size),},
+{"remove",0,PARAM_NOSTATIC,"Remove","p(x key)",PROCEDURE(p_remove),"Removes the named or indexed element (depending on the argument type: string or int)."},
+{"get",0,PARAM_NOSTATIC,"Get element","p x(x key)",PROCEDURE(p_get),"Retrieves the named or indexed element (depending on the argument type: string or int). null is returned for nonexistent keys.\nobject.get(key) can be shortened to 'object[key]'"},
+{"getKey",0,PARAM_NOSTATIC,"Get a key","p s(d index)",PROCEDURE(p_getKey),"Returns the key of the indexed element (0 <= index < size)"},
+{"set",0,PARAM_NOSTATIC,"Set element","p(x key,x value)",PROCEDURE(p_set),"Set element value for the specified key or index (depending on the argument type: string or int).\nobject.set(key,value) can be shortened to object[key]=value"},
+{"find",0,PARAM_NOSTATIC,"Find","p x(x value)",PROCEDURE(p_find),"Returns the element key or null if not found."},
+{"new",0,0,"Create a Dictionary","p oDictionary()",STATICPROCEDURE(p_new),"Empty directory can be also created using the {} expression."},
+{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"Textual form","s",GETONLY(toString),},
 {0,0,0,},
 };
