From: Clark C . E. <cc...@cl...> - 2002-03-15 23:08:08
|
On Fri, Mar 15, 2002 at 04:35:55PM -0500, Oren Ben-Kiki wrote: | Nope because a parser produces the tree model and one can only detect a | subset of the duplicate keys there. Right; there may be "application defined" duplication errors above and beyond what the parser can detect, and this is the loader's concern (or the application's concern if the loader doesn't catch them). However, IMHO, it'd be prudent to have the parser reject flat out duplicate keys that it can detect. If we don't, we will have some yahoo who says that the mapping below has unique keys... orders: !invoice new: first invoice !invoice new: second invoice *shudder* Thus, I think the parser should eliminate duplicates that it knows about (via straight string comparision) and that loaders can then eliminate other duplicates as appropriate. Since the parser doesn't build the in-memory graph, it is the loader's responsibly to resolve & and * constructs. | *Can't* be detected as a duplicate by a mere parser. One can only make it a | fatal error in the loader level; however there I see no reason to completely | rule out the "ignore duplicate key" policy. You've already parsed it | anyway... I'm leaning to making duplicate keys a fatal error at what ever stage of the game they are detected. Let each stage do its own checking. | I expect this to be a sticky issue. No really good solution for it. It is | best we let the application decide what the intelligent thing to do is in | each case, as long as it is crystal clear it is an error case. And, for portability reasons, have the parser and loader reject what ever it can reject... Best, Clark |