From: Brian I. <in...@tt...> - 2004-08-05 21:56:05
|
On 05/08/04 15:05 -0600, why the lucky stiff wrote: > Brian Ingerson wrote: > > >To answer Why's dilemma, the 'y' in the &ORIGIN mapping should probably > >be loaded as a string, not a boolean. Why's challenge (and yours as > >well) is to create a YAML processor that allows the programmer to tell > >it that a certain document, or branch or node might be using 'y' for > >boolean true. > > > > > So in cases where 'y' is a key, it would be loaded differently than in > situations where 'y' is a value? I've never heard of this. That's not what I saying... > >I think Why is trying to support a mode, where all the YAML implicit > >typing is happening at once. I don't think this is very useful in > >practice. The best option is to default to strings, and let the user > >"turn on" application specific typing conversions. > > > > > Sure, come come.. what is the default "mode"? What I'm saying is, make your YAML module always load strings by default. No implicit typing at all. That's the recommended default. Then allow for type converter plugins to be selected by the programmer. You should probably author the plugins that support the yaml.org type recommendations... but allow for others to write their own type converters. If you think about it even specific objects are just type conversions: --- - !graph/point x: 1 y: 2 z: 3 ... In this case, there is a type conversion class associated with the 'graph/point' uri. The converter is probably just part of your Point class and is probably inherited from some YAML class. So some type conversions key off of uris (explicit), and some key off of pattern matching (implicit). And in the future, some will key off of schema documents. (Oren, let me know if I've overstepped any bounds) BTW, I'm not dictating exactly how a YAML processor must be implemented. I think there are many ways to do it. Just recommending some useful guidelines. Cheers, Brian PS Why, my posts are not getting to sourceforge in a timely manner. Could you please forward them? |