On 12/3/05, Maximilian Wilson <[EMAIL PROTECTED]> wrote:
[1] If you're concerned about efficiency, and the number of data fields is fixed, you could use an array instead, as long as you have a set of variables for each index. E.g. Father = 1, Children = 2, etc. Then you call pos.Father instead of pos.father, but you get to use array indexing instead of dictionary indexing. I don't actually know how much more efficient this is except that dictionaries are an O(1) operation too.

One final note: you may be thinking to yourself that a record with cells as features would actually be a better idea. The problem is that X.Y := Z is parsed as a trinary operator on X, Y, and Z, and Mozart expects X to be an array or dictionary, not a record. If you want record.cell := val to work, you have to declare paranthesize it as (record.cell) := val. Not too bad but a little bit awkward IME.

Max


--
Be pretty if you are,
Be witty if you can,
But be cheerful if it kills you.
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to