Oren Ben-Kiki wrote:
>
Sorry guys. I'm a little busy this week. I started to reply to Oren's
message yesterday, but abandoned it because I couldn't give it the
required brain power. I'll try to comment quickly.
> Clark C . Evans [mailto:cce@...] wrote:
> > On Tue, May 29, 2001 at 07:06:42PM +0200, Oren Ben-Kiki wrote:
> > | Supposing the information model does make this distinction
> >
> > Ok. Let's make the binary/unicode distinction in
> > the information model.
>
> Brian? Can you say a word on how this would work in Perl?
Perl is a little up in the air on Unicode. I believe that recent
versions use UTF8 by default for *most* string operations. A byte mode
can be set to default back to the good ole days.
FWIW, I suggest using the single quote for Unicode data. (Get it? *Uni*
code :-). Using Clark's backtick for binary base-64 data. Using '|,\'
for blocks. Using double quotes for everything else (folded streams).
Unquoted streams are a convenience option for single line values only.
>
> > | === Classes and Color ===
> > ...
> > I'd like to hear brian's perspective on this one. I actually
> > kinda like it, although I'm partial since we had talked about it
> > for a long time on the sml-dev list. We would need to push forward
> > on the API notion of "getValue()" as returning the node with
> > a blank key. Building this mechanism in is very cool since it
> > allows for "schema substitutability". However, I'm not sure
> > how well it works for data serilization....
>
> Hmmm. If one is serializing a built-in map/list/scalar, you do it normally;
> when serializing an "Object" it probably gets serialized into a map, with a
> class attribute. It is only "typed scalars" which are a problem (e.g., a
> number, a date, etc.). One problem about the proposed class-as-color syntax
> is that it is rather cumbersome for something like a simple number...
Classes are a can of worms.
Although I'm not against the color idea, Perl will never embrace the
idea of having everything be an object. Using getValue() as the normal
method of retrieving a simple value is just too much work for Perl
people. A map should just become a hash, plain and simple. I can come up
with some creative ways of preserving YAML classes in Perl
transparently, but my plate's too full right now.
(I'm trying to be a famous Perl guy in other realms, ya know ;)
>
> > (on a technical note, I think "", a blank key, should be the
> > default value for a node, and perhaps "__class__" could be
> > the class name).
>
> I rather like '=' for 'value' - it has the right intuitive semantics.
> '__class__' for type is too verbose for my taste.
Agree.
> > The primary rationale for the [ and " formats breaking
> > the indentaiton rules is to allow for easy cut and paste.
>
> I don't buy that. Cut&paste implies a tool - an editor or a program. Most
> editors allow you to trivially indent a group of lines - certainly any
> editor used for writing YAML had better support it. And a program doing
> cut&paste can add indentation easily enough.
>
> Besides, if "raw" cut&paste is that important, doesn't it apply to blocks as
> well? we can simply use:
>
> block: |===arbitrary marker line===
> block text,
> raw, not indented at all,
> no prefix for the lines,
> cut & paste into it whichever way you want.
> |===arbitrary marker line===
> \===arbitrary marker line (if no trailing newline)===
>
> Perl people know this as the '<<EOF' approach :-) This would leave simple
> scalars as the only type of value which must be indented - and given that
> most of these are single-line, that hardly matters. You'd end up with files
> where every multi-line value is not indented, which I think will really ruin
> readability. I'd rather we stick with strict indentation for everything,
> including blocks, blobs and double-quoted streams.
I think it's nice to allow the cut-and-paste and let emitters always
reformat. But I'll support strict for now.
>
> Separate issue: having both double-quoted and simple scalar values. Here's a
> proposal to use just one form:
>
> - Block: as today, but use ` instead of \ to mark the end line.
> - Scalar value: as today, allow escaping using \, always allow it to be
> multi-line, but the continuation lines must be more indented then the first
> line.
> - List: as today (no special marker), but allow : as an optional prefix for
> scalar values.
>
> Example:
>
> @
> Ugly multi
> line text
> Pretty single line text with NL\n
> : Ugly single line text w/o NL
> : Pretty multi
> line text
> |multi line
> |block with NL
> `
> |multi line
> `block w/o NL\n
> [base64
> blob]
>
> Everything is always strictly python-indented.
Whatever :(
If you are once again suggesting dropping double quotes, you're
needlessly going down a road of pain. Double quotes are simple,
intuitive and will always work for folded text (indented or not).
>
> > I'm not going to be able to put much more time into
> > this in the next few months, as I'm a key player
> > in a start-up, xgenda.com, which hopes to publicly
> > launch our product by September.
>
> Hmmm. As I see it, we have at least one major issue to resolve (the class
> issue) plus another where a "dictator hat" may be required (the text
> syntax). Then we can all start doing development at our own pace...
I'll volunteer as dictator :)
I want to start doing something on this after June 15th or so. I hope we
can resolve things by then. We were very close last week.
Cheers, Brian
--
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'
|