From: Clark C. E. <cc...@cl...> - 2004-08-08 19:50:55
|
Regarding implicit types, there are a few things that must be done: (a) Update the main specification to make it absolutely clear that implicit typing is optional (b) Update the type repository to be consistent with examples and with itself. Personally, I don't like implicit types; at least not the "ambiguous" ones we currently have. It makes for a big wart in the specfication where we carry a plain-type flag all the way into the representation (aka graph) model for items which could-possibly-be-impliclty-typed. Frankly, it's ugly. What I'd like to see is a simple directive, where one "names" the implicit types you are using. If a parser doesn't know about one or more of the implicit types mentioned, it issues a warning, and continues. Something like, --- %YAML:1.0 %IMPLICIT:bool;number;date;null boolean: True # !bool number: 304.34 # !number date: 2003-03-02 # !date null: Null # !null ... vs --- %YAML:1.0 boolean: True # !str number: 304.34 # !str date: 2003-03-02 # !str null: Null # !str ... In this way, no %IMPLICIT, no implict typing. If you want an implict type, you declare it using the directive. It cleans up the model, and makes the YAML text portable or at least helps parsers issue warnings when they don't know about an implicit type. Later on, we can add a %SCHEMA directive which will be much more flexible in the declarations, etc. But for now, a %SCHEMA is just out-of-scope. %IMPLICIT is quite simple and straight-forward. Cheers! Clark |