At 3:40 PM +0100 12/22/05, Michele Dondi wrote:
On Thu, 22 Dec 2005, Darren Duncan wrote:
On a separate but related matter, I'm in the position of wanting to
do something unusual, which is create a data file format whose
content is executable perl code that defines a data structure, a
hash of whatever.
Kind of like how XML works except that Perl can natively parse it.
On an even more separate but related matter, I've been desiring to
stuff in the already multiparadigmatic nature of Perl6 "markup
language(-like) features" myself. Not data that represents
markup-language text. Stuff in the code that _is_ as opposed to
stuff that _does_ (something), and specifies a structure, but
"links" nicely with other stuff that actually does something.
I had been thinking of this especially in connection with GUIs or
more generally even-driven programming, but I don't think it should
be limited to those respects. It would just be nice to have it
available in our syntactical/semantical toolbox. Since I have not
clear/definite ideas about both the effective usefulness of such a
beast nor about how it could actually look like, I didn't receive
much attention, but if you're interested you look up "markup" in the
archives...
I can't comment on that at the moment, as I'm not sure of its value,
since what Perl already has built-in may be up to the task as is.
But I will post a reply to my own comment in that, following a
discussion on #perl6 last night following my p6l post, I may very
well just be using YAML for the data file instead of data-defining
perl code, though the perl option may be kept as an option if the
YAML doesn't work out, or for other purposes (I had already been
using perl for config files in the past).
Pugs has built-in support for parsing YAML right now, and I was also
told that support for generating YAML should be added this weekend.
The current parsing support is overloaded into 'eval', where you give
a second ":lang<yaml>" argument, so the first string argument is
treated as yaml, and the eval returns the corresponding Perl 6 data
structure.
-- Darren Duncan