Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PIR version of Data::Dumper

6 views
Skip to first unread message

Jens Rieks

unread,
Feb 5, 2004, 7:01:34 AM2/5/04
to perl6-i...@perl.org
Here is a first version of a "Data::Dumper" i've written to be able to dump
the AST of my C parser.

A dumpertest.imc is included, which shows the dumper in action.
I'am sorry, but I have no idea how to convert this to a test. BTW, is the
order of the hash elements guaranteed to be equal across platforms?

jens

dumper.imc

Leopold Toetsch

unread,
Feb 5, 2004, 8:35:38 AM2/5/04
to Jens Rieks, perl6-i...@perl.org
Jens Rieks <par...@jensbeimsurfen.de> wrote:

> Here is a first version of a "Data::Dumper" i've written to be able to dump
> the AST of my C parser.

Wow, fine.

> A dumpertest.imc is included, which shows the dumper in action.

s/included/missing/ :)

> I'am sorry, but I have no idea how to convert this to a test.

Test::More provides C<is_deeply> to compare structures.

> ... BTW, is the


> order of the hash elements guaranteed to be equal across platforms?

Just the opposite, its guaranteed to be not the same even on one
platform, albeit a srand() like call is still missing to get really
random key order.

> .include "../../runtime/parrot/include/datatypes.pasm"

That should just be

.include "datatypes.pasm"

... at least, if run from parrot root (which we currently presume)

BTW - we still have the mess with 2 different library directories:
- library
- runtime/parrot/*

We really should clean that up, before more and more code goes in.
I'd rather have:

- runtime/parrot/lib

that is all files that need installation in one place.

leo

Jens Rieks

unread,
Feb 5, 2004, 10:25:49 AM2/5/04
to l...@toetsch.at, perl6-i...@perl.org
Am Donnerstag, 5. Februar 2004 14:35 schrieb Leopold Toetsch:
> Jens Rieks <par...@jensbeimsurfen.de> wrote:
> > Here is a first version of a "Data::Dumper" i've written to be able to
> > dump the AST of my C parser.
>
> Wow, fine.
>
> > A dumpertest.imc is included, which shows the dumper in action.
>
> s/included/missing/ :)
dumpertest.imc got stripped, I have resend it.

>
> > I'am sorry, but I have no idea how to convert this to a test.
>
> Test::More provides C<is_deeply> to compare structures.

Hmm, I'll have a look at it later. The C parser has a higher priority atm.

> > ... BTW, is the
> > order of the hash elements guaranteed to be equal across platforms?
>
> Just the opposite, its guaranteed to be not the same even on one
> platform, albeit a srand() like call is still missing to get really
> random key order.
>
> > .include "../../runtime/parrot/include/datatypes.pasm"
>
> That should just be
>
> .include "datatypes.pasm"
>
> ... at least, if run from parrot root (which we currently presume)

Oops, fixed. Now it is "runtime/parrot/lib/dumper.imc"

> BTW - we still have the mess with 2 different library directories:
> - library
> - runtime/parrot/*
>
> We really should clean that up, before more and more code goes in.
> I'd rather have:
>
> - runtime/parrot/lib
>
> that is all files that need installation in one place.

Sounds okay. The different include paths we have are a bit messy...

> leo
jens

Jens Rieks

unread,
Feb 5, 2004, 10:30:38 AM2/5/04
to l...@toetsch.at, perl6-i...@perl.org

I'am a bit messy, too :-)
Forgot to include the new file. The _init_dumper function is removed, it uses
the C<errorsoff> from latest CVS to prevent exception raising if the global
does not exists.

> > leo
>
> jens

dumper.imc

Tim Bunce

unread,
Feb 5, 2004, 4:31:00 PM2/5/04
to Leopold Toetsch, Jens Rieks, perl6-i...@perl.org
On Thu, Feb 05, 2004 at 02:35:38PM +0100, Leopold Toetsch wrote:
> Jens Rieks <par...@jensbeimsurfen.de> wrote:
>
> > Here is a first version of a "Data::Dumper" i've written to be able to dump
> > the AST of my C parser.
>
> Wow, fine.
>
> > A dumpertest.imc is included, which shows the dumper in action.
>
> s/included/missing/ :)
>
> > I'am sorry, but I have no idea how to convert this to a test.
>
> Test::More provides C<is_deeply> to compare structures.
>
> > ... BTW, is the
> > order of the hash elements guaranteed to be equal across platforms?
>
> Just the opposite, its guaranteed to be not the same even on one
> platform, albeit a srand() like call is still missing to get really
> random key order.

So it would be really nice to have a "Data::Dumper" be able to sort
the keys, like the Perl one now can.

Tim.

Leopold Toetsch

unread,
Feb 6, 2004, 2:25:06 AM2/6/04
to Tim Bunce, perl6-i...@perl.org

That's not specific to Data::Dumper. We are just lacking a sort routine.

> Tim.

leo

0 new messages