Hi --

On Tue, 9 Sep 2003, Chad Fowler wrote:

> On Tue, 9 Sep 2003, why the lucky stiff wrote:
>
> #
> # Looks like YAML just about.  Save yourself the parsing and go for:
> #
>
> I was thinking the same.  Good idea.
>
> <snip />
>
> # Even better, check out the %y{ ... } patch:
> #
> #    http://whytheluckystiff.net/ruby/ruby-1.8.0-yamlstr.patch
> #
>
> I think this is a really nifty patch, but I have a concern.  If Ryan were
> to use this syntax (and your patch), his library would require a modified
> Ruby interpreter, which would severely limit the acceptance and usage of
> the library.  Also, being a one-off patch, we would be basically getting a
> strong-hold on %y{}, which would present problems if the ruby interpreter
> some day implemented %y{} for something else.
>
> Now, you may say "let's just add this to the core ruby interpreter."
>
> My opinion is that if we're going to add special syntax for YAML, we
> should have syntax for XML %xml{} (and potentially CSV %csv{} and other
> formats).  It doesn't make sense to me to implement YAML or XML as a core
> part of the language.  I like the fact that we've got high
> quality libraries for them, and I like the fact that these libraries are
> included with the standard Ruby distribution, but I wouldn't want to see
> them creep into the actual language syntax.
>
> Any other thoughts on this one?

I agree with your points (about both the strength of the libraries and
the pitfalls of patching) -- and it also reminds me of an idea from
long ago that I never researched the feasibility of very deeply....
Namely, the idea of an extensible %_{} syntax, so that one could
define the behavior of %y{}, %x{}, and so on from within a Ruby
program or extension.

Perhaps someone steeped in the ways of the parser could comment on
how hard this would be (up to and including impossible).


David

-- 
David Alan Black
home: dblack / superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav