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

[perl #32117] [PATCH] new multifacetted pmc: siva

2 views
Skip to first unread message

Stephane Payrard

unread,
Oct 23, 2004, 6:31:27 PM10/23/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Stephane Payrard
# Please include the string: [perl #32117]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=32117 >


Siva is a type that acts as a hash, array , string scalar, int
scalar. It is intended as the type for nodes of attributed trees
These attributed trees may probably be of various kinds such as
parse trees and XML trees. The intensive use of context should
minimize explicit structure walking.

Hashes and arrays are allocated only when needed.

I have a problem with siva.t. The pasm code is the same as
siva.pasm though.

The name is a reference to the hindouist god siva often represented
with many arms.


Files modified:
config/gen/makefiles/dynclasses.in

Files created:
dynclasses/siva.pmc
dynclasses/siva.pasm
dynclasses/siva.t


siva001.patch

Leopold Toetsch

unread,
Oct 24, 2004, 6:58:48 AM10/24/04
to perl6-i...@perl.org
Stephane Payrard <parrotbug...@parrotcode.org> wrote:

> Siva is a type that acts as a hash, array , string scalar, int
> scalar. It is intended as the type for nodes of attributed trees
> These attributed trees may probably be of various kinds such as
> parse trees and XML trees. The intensive use of context should
> minimize explicit structure walking.

> Hashes and arrays are allocated only when needed.

> I have a problem with siva.t. The pasm code is the same as
> siva.pasm though.

What problem?

> +/* rhs and lhs versions needed to avoid the msg "warning: use of cast expressions as lvalues is deprecated"

Have a look at LVALUE_CAST()

> +#define siva_hash(a) ((siva*) PMC_pmc_val(a))->hash

> +#define siva_str(a) ((siva*) PMC_pmc_val(a))->s

What happens, if I create a hash and extract a string?


leo

Stéphane Payrard

unread,
Oct 24, 2004, 10:40:10 AM10/24/04
to perl6-i...@perl.org
I am currently stuck because I get the error
parrot: src/string.c:269: string_init: Assertion `p' failed.
on the second string_init of a parrot run using the last vanilla cvs

It may be a problem with mandrake cooker.
Jérôme Quelin uses a older mandrake cooker and it works there.
Comparing our config, it seems that the main difference is

he got:

set P0["buildicu"], "1"

and I have:

set P0["buildicu"], "0"

in config_lib.pasm

I have yet to check further.

So I may imprecise in my answers because I can't currently run
tests.

Also, I should have put a disclaimer, many pmc methods are still
missing. This is an early submission to get feedback.


On Sun, Oct 24, 2004 at 12:58:48PM +0200, Leopold Toetsch wrote:
> Stephane Payrard <parrotbug...@parrotcode.org> wrote:

> > Siva is a type that acts as a hash, array , string scalar, int
> > scalar. It is intended as the type for nodes of attributed trees
> > These attributed trees may probably be of various kinds such as
> > parse trees and XML trees. The intensive use of context should
> > minimize explicit structure walking.
>
> > Hashes and arrays are allocated only when needed.

I meant for a given pmc, the hash, array, or string that it may
contain is allocated only when necessary.

>
> > I have a problem with siva.t. The pasm code is the same as
> > siva.pasm though.
>
> What problem?

Apparently, there is a problem in the reading of siva.so.
I did not yet check how Parrot::Test run that makes the parrot
run differently than running directly parrot dynclasses/siva.pasm
siva.t must be updated anyway to reflect that I made siva a
dynamically loaded pmc.

>
> > +/* rhs and lhs versions needed to avoid the msg "warning: use of cast expressions as lvalues is deprecated"
>
> Have a look at LVALUE_CAST()
>
> > +#define siva_hash(a) ((siva*) PMC_pmc_val(a))->hash
>
> > +#define siva_str(a) ((siva*) PMC_pmc_val(a))->s
>
> What happens, if I create a hash and extract a string?

Should work. They live in different fields of the siva struct. At
this point my tests in siva.pasm were just that: toverify that the
different structures are correctly allocated and that they don't
overlap.

--
stef

>
>
> leo
>

0 new messages