From: Brian I. <in...@tt...> - 2002-09-07 14:59:27
|
On 07/09/02 09:52 +0200, Rolf Veen wrote: > Clark C . Evans wrote: > > > What do you think about requiring parenthesis around all items > > which are implicitly typed? > > > > strings: > > - 23 > > - 2002-01-02 > > - true > > - 2.3 > > typed: > > integer: (23) > > timestamp: (2002-01-02) > > boolean: (true) > > floating: (2.3) > > > > > I'll repeat myself: > > strings: > - 23 > - 2002-01-02 > - true > - 2.3 > typed: > integer: ! 23 > timestamp: ! 2002-01-02 > boolean: ! true > floating: ! 2.3 > typed: > integer: !int 23 > timestamp: !time 2002-01-02 > boolean: !bool true > floating: !float 2.3 +1 on the above parens: integer: (23) timestamp: (2002-01-02) boolean: (true) floating: (2.3) This syntax is a little nicer looking than '! foo'. I could go either way, but I'd prefer both ways. > > and my vote for this proposal :-): > > +1 > > The single transfer indicator turns implicit type detection > on. This is compatible with an #IMPLICIT directive, also. > The #IMPLICIT directive defines the default. No directive means > OFF. Just turning implicit typing on/off is a good start. But Clark's breakthrough of specifying *which* implicits, and my breakthrough of grouping them into classes, is much more powerful. It allows a user to select their implicits for various domains. It allows us to come up with many more implicit patterns than we were comfortable with before. Currency anyone? Most importantly it allows user domains to define their own implicits. The key was to get explicit about being implicit. And when you're completely implicit you get strings, which seems to cause the least trouble by far. > > Also -1 for using '-' as an implicit boolean. It complicates > the productions. Grammar complexity surfaces up to the user > level, which has to remember too many rules when writing or > reading a YAML file. +1 But that's a fight for a different day :) Cheers, Brian |