Two questions on Dict.h: Object *getVal(int i, Object *obj); Object *getValNF(int i, Object *obj);
- What's the difference between those functions?
The difference is only when the requested object is a Reference. The "NF" (no fetch) version returns the reference; the regular version of the function fetches the full object and returns that.
- What purpose has the obj parameter since the value is returned?
Those functions fill in *obj, and then return obj. (I was trying to avoid passing around Objects, for efficiency.) So typical usage is something like this: Object obj; dict->getObj("key", &obj); It returns the pointer for convenience, so you can do things like: if (dict->getObj("key", &obj)->isNum()) { ... } which is exactly equivalent to: dict->getObj("key", &obj); if (obj.isNum()) { ... } - Derek