Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
setting properties in PMC init
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
K Stol  
View profile  
 More options May 15 2003, 7:48 am
Newsgroups: perl.perl6.internals
From: k_s...@hotmail.com (K Stol)
Date: Thu, 15 May 2003 13:11:14 +0200
Local: Thurs, May 15 2003 7:11 am
Subject: setting properties in PMC init

Hello,

I was wondering if it is possible to call "setprop" from within the init function from a PMC.
I want all PMC's of a particular type to have some property.
so:

void init {
    /* do init stuff */
    /* create a keystring, called "keystring" */
    /* create some value, in this case also a string: "valuestring" */

    /* looked up prototype in "include/parrot/vtables.h", not sure about 2nd argument */

    SELF->vtable->setprop(INTERP, SELF, (PMC *)keystring, (PMC *)valuestring);

}

This will compile, but when I "getprop" in PASM, it won't run. So, I'm doing something wrong.
Has anybody an idea?
Thanks in advance.

Klaas-Jan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "patch for Win32 (longopt.c)" by Nick Kostirya
Nick Kostirya  
View profile  
 More options May 15 2003, 8:48 am
Newsgroups: perl.perl6.internals
From: n...@han.kherson.ua (Nick Kostirya)
Date: Thu, 15 May 2003 15:39:19 +0300
Local: Thurs, May 15 2003 8:39 am
Subject: patch for Win32 (longopt.c)
For successful building parrot under Win32 need define snprintf as _snprintf
into longopt.c file.

#ifdef _WIN32
#  define snprintf _snprintf
#endif

'josh' did it for spf_vtable.c before (Revision : 1.17; Date : 2003/1/4
3:29:36; Description: Indenting fixes, etc.)

With this patch
All tests successful, 24 subtests skipped.
Files=47, Tests=686, 590 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00
CPU)

Nick.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Gray  
View profile  
 More options May 15 2003, 9:48 am
Newsgroups: perl.perl6.internals
From: bruce.g...@acm.org (Bruce Gray)
Date: Thu, 15 May 2003 07:58:45 -0500
Local: Thurs, May 15 2003 8:58 am
Subject: Re: patch for Win32 (longopt.c)

Thank you for your work on this.

Unfortunately, this exact change was submitted earlier this week (by me),
and contested; Brent Dax thinks that Parrot_snprintf should be used
instead. The longopt author, Luke Palmer, did not disagree. See:
  http://bugs6.perl.org/rt2/Ticket/Display.html?id=22174
  Ticket #22174 [PATCH] snprintf link errors on Win32

Later today, I will submit a patch to match Brent's request. If he and Luke
raise no objection, I will commit it, otherwise I will commit the original
patch until we work out a better solution.

--
Hope this helps,
Bruce Gray


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "setting properties in PMC init" by Leopold Toetsch
Leopold Toetsch  
View profile  
 More options May 15 2003, 9:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Thu, 15 May 2003 14:02:23 +0200
Local: Thurs, May 15 2003 8:02 am
Subject: Re: setting properties in PMC init

In perl.perl6.internals, you wrote:
> I was wondering if it is possible to call "setprop" from within the init =
> function from a PMC.
> I want all PMC's of a particular type to have some property.

Should be no problem. When C<init> gets called on a newly created PMC
everything is already in place. The only thing to worry about is loosing
the newly created PMC due to infant mortality. So placing the call
between Parrot_DOD_block / _unblock is probably necessary.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 15 2003, 9:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Thu, 15 May 2003 14:06:56 +0200
Local: Thurs, May 15 2003 8:06 am
Subject: Re: setting properties in PMC init

In perl.perl6.internals, you wrote:
>     SELF->vtable->setprop(INTERP, SELF, (PMC *)keystring, (PMC =
> *)valuestring);

Ah hoppala:

> This will compile, but when I "getprop" in PASM, it won't run. So, I'm =
> doing something wrong.=20

Third parameter is a real STRING (the key), last is a PMC in your case
a PerlString - the value. No casts necessary/allowed.
Please have a look at default.pmc and the property tests.

> Klaas-Jan

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "patch for Win32 (longopt.c)" by Josh Wilmes
Josh Wilmes  
View profile  
 More options May 16 2003, 9:48 pm
Newsgroups: perl.perl6.internals
From: j...@hitchhiker.org (Josh Wilmes)
Date: Fri, 16 May 2003 21:09:02 -0400
Local: Fri, May 16 2003 9:09 pm
Subject: Re: patch for Win32 (longopt.c)

I wouldn't assume that I knew what I was doing ;-)   These days, i think
something with Parrot_sprintf would be the way to go..   I'm pretty out of
touch though.

--Josh

At 15:39 on 05/15/2003 +0300, "Nick Kostirya" <n...@han.kherson.ua> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »