From: Clark C . E. <cc...@cl...> - 2001-06-03 15:47:06
|
On Sun, Jun 03, 2001 at 05:15:56PM +0200, Oren Ben-Kiki wrote: | I had this notion about the syntactical form of class-as-color (or any | color). What if one allows the first key pair to appear immediately after | the '%': | | delivery: % : 10-JAN-2001 | # : date | | OK, the class has to appear on a separate line, but that's not *too* bad, | textually. Especially after removing some whitespace: | | delivery:%: 10-JAN-2001 | #: date If we want to "abbreviate", why not just allow the single line form... delivery: !date 10-JAN-2001 to be an abbreviation for ... delivery: % ! : date "" : 10-JAN-2001 Thoughts? The above form is what would be exposed through the information model. | I'm using your "value is the empty key" syntax, to reduce the "line noise" | effect. Speaking of line noise, how about saying that by convention, the '~' | ("null") can be used as a key to denote comments: | | map: % | ~ : This map contains this and that... | key : value | ... | | delivery:%: 10-JAN-2001 | #: date | ~: This is a comment about the delivery date | | Comments are just another color! This solves all our problems with them | (being in the info model on the one hand, but being ignored by applications | on the other). I *love* the color idiom. I do as well. It may seem like extra noise if you are just worried about classes... however, when you start to add other colors, it becomes a very powerful mechanism... Hmm. Just thinking. The pattern above could work for any indicator used as a key... delivery: !date #"Comment on delivery" 10-JAN-2001 | Now, if there's a way to de-serialize the above into something which behaves | "like a string" in Perl/Python... For Python, I think it works well. All maps with a recognized "class" attribute are converted to a class on load (if they are recognized) otherwise they are left as maps. This works well. Best, Clark P.S. I think I'd like to use # for comment and ! for class, what do you think? |