News for hackers. Stuff that matters.
Re:TOML, Tom's Own Markup Language by Comkid on Saturday February 23, 2013 @11:04PM (#5272750)
Would this be considered legal?

  [ [1,2], ["a", "b"] ]
Re:TOML, Tom's Own Markup Language by kazoolist on Saturday February 23, 2013 @11:16PM (#5272797)
I wondered the same thing. "No, you can't mix data types, that's stupid" leaves it ambiguous.

If you parse the outer array as just "array of arrays" (as each element is an array), you're not "mixing". But if we're supposed to be parsing it as "arrays of arrays of _type_", then we are mixing.

Re:TOML, Tom's Own Markup Language by mikegirouard on Saturday February 23, 2013 @11:11PM (#5272781)
The README says not to mix data types because "that's stupid" (which I don't know if I agree with); but I don't know if that answers your question.

You have an array of array, which at that level, satisfies the spec. The children individually keep types contained.

That said, I'm going to assume the intent is to not allow that.

Re:TOML, Tom's Own Markup Language by Comkid on Saturday February 23, 2013 @11:19PM (#5272804)
Would it be okay to understand arrays as integer indexed keys?

For example, wouldn't that mean something like:

  array = [ [1,2], ["a", "b"] ]
Be the same as this:

  [array]
  0 = [1,2]
  1 = ["a", "b"]
Re:TOML, Tom's Own Markup Language by rjsamson on Sunday February 24, 2013 @12:06AM (#5272944)
This has now been clarified - it is legal
Re:TOML, Tom's Own Markup Language by burntsushi on Sunday February 24, 2013 @12:10AM (#5272955)
Which I find to be quite odd [1]. Data types in `TOML` can be mixed at the level of the hash table. Arrays ought to be homogeneous.

[1] - https://github.com/mojombo/toml/issues/28

Re:TOML, Tom's Own Markup Language by burke on Saturday February 23, 2013 @11:45PM (#5272881)
It's unspecified, I guess, but if you want to read into the spirit of it, which is to make it trivially-supportable by type-nazi languages such as haskell, you either get a [[Int]] or a [[String]].
Re:TOML, Tom's Own Markup Language by mbetter on Sunday February 24, 2013 @02:37AM (#5273292)
I don't know how much it is going to help as you're going to have to wrap the values anyway to get a Map with heterogeneous values.