I have been playing with classes and instances for parrot. In
the process I found I needed a way to pass more information when
creating new pmcs. So the attached patch adds the op:
new (out PMC, in INT, in PMC)
which calls the vtable function:
void init_pmc (PMC* initializer)
My code that uses this op is not ready to submit, so the patch
does not include tests. However, if this op is wanted, the patch
should be safe to commit (all existing tests pass).
Later.
--
Jonathan Sillito
-- attachment 1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/39411/31983/683b0f/new_pmc.patch
> I have been playing with classes and instances for parrot. In
> the process I found I needed a way to pass more information when
> creating new pmcs. So the attached patch adds the op:
> new (out PMC, in INT, in PMC)
Oh, I see nobody has replied to this yet. Well, in the past this
feature existed in Parrot, but then was taken out again, presumably
because there was a better way to do it. However, I'm not sure what
that way may be. Can anyone shed some light upon this?
Leon
--
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/
.... The weirdest thing just happened to me
> Jonathan Sillito sent the following bits through the ether:
>
>
>>I have been playing with classes and instances for parrot. In
>>the process I found I needed a way to pass more information when
>>creating new pmcs. So the attached patch adds the op:
>> new (out PMC, in INT, in PMC)
>>
>
> Oh, I see nobody has replied to this yet. Well, in the past this
> feature existed in Parrot, but then was taken out again, presumably
> because there was a better way to do it. However, I'm not sure what
> that way may be. Can anyone shed some light upon this?
As I wrote WRT array creation, we would need such an op to pass the data
type (and for multiarrays the array dimensions).
> Leon
leo
On Mon, 14 Oct 2002, Leon Brocard wrote:
> Jonathan Sillito sent the following bits through the ether:
>
> > I have been playing with classes and instances for parrot. In
> > the process I found I needed a way to pass more information when
> > creating new pmcs. So the attached patch adds the op:
> > new (out PMC, in INT, in PMC)
>
> Oh, I see nobody has replied to this yet. Well, in the past this
> feature existed in Parrot, but then was taken out again, presumably
> because there was a better way to do it. However, I'm not sure what
> that way may be. Can anyone shed some light upon this?
>
I have submitted a few patches that enables this feature though it
has been forgotten for some reason :-). I believe it is needed because
some pmcs ( not yet applied ) do need to know a few things on init par
example matrices. My patches was 16933 and 16934
/Josef