Re: [perl #41583] Tail calls from within vtable methods broken

2008-06-14 Thread chromatic
7, The Perl Foundation. +# Copyright (C) 2001-2008, The Perl Foundation. # $Id$ use strict; @@ -7,7 +7,7 @@ use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 97; +use Parrot::Test tests => 98; =head1 NAME @@ -2489,6 +2489,37 @@ /too many argument

[perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2008-05-17 Thread Patrick R. Michaud via RT
On Sun Mar 16 09:20:55 2008, [EMAIL PROTECTED] wrote: > On Mon Mar 12 05:40:14 2007, [EMAIL PROTECTED] wrote: > > I'm still working on my use case, but it appears the new MetaClass PMC > > (src/pmc/metaclass.pmc) could use this vtable method as well; currently it > > only has an add_attribute PMETH

Re: [perl #53066] consting vtable methods

2008-04-22 Thread NotFound
Hello > Just popping in to say that we cannot const any parms to vtable methods. > Parrot can't impose promises on the called code. The attached patch drops the :const attribute in isa and get_class methods. A lot of cast warnings disappear, and all tests pass in my system. --

Re: [perl #53066] consting vtable methods

2008-04-22 Thread Nicholas Clark
On Sat, Apr 19, 2008 at 01:55:18PM -0700, Mark Glines wrote: > On Sat, 19 Apr 2008 21:45:49 +0200 > NotFound <[EMAIL PROTECTED]> wrote: > > The same applies to some parameters attributed as non null, and > > explicitly called with NULL argument in several locations. How can a > > cleaner figure wh

Re: [perl #53066] consting vtable methods

2008-04-20 Thread Andy Lester
On Apr 20, 2008, at 2:37 PM, Mark Glines wrote: Failure to do so results in an "incompatible pointer" warning, just like any other kind of prototype mismatch. And that in my mind is equivalent to "can't." xoxo, Andy -- Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance

Re: [perl #53066] consting vtable methods

2008-04-20 Thread Mark Glines
On Sun, 20 Apr 2008 21:01:01 +0200 NotFound <[EMAIL PROTECTED]> wrote: > On Sun, Apr 20, 2008 at 12:17 AM, Andy Lester <[EMAIL PROTECTED]> > wrote: > > > Just popping in to say that we cannot const any parms to vtable > > methods. Parrot can't impose promis

Re: [perl #53066] consting vtable methods

2008-04-20 Thread NotFound
On Sun, Apr 20, 2008 at 12:17 AM, Andy Lester <[EMAIL PROTECTED]> wrote: > Just popping in to say that we cannot const any parms to vtable methods. > Parrot can't impose promises on the called code. So take for example In default.pmc the method get_class: VTABLE PMC *get_cla

Re: [perl #53066] consting vtable methods

2008-04-19 Thread Andy Lester
Just popping in to say that we cannot const any parms to vtable methods. Parrot can't impose promises on the called code. Take for example whatever the vtable method is to return the count of elements in the array. You'd think this would easily be constable, but we cannot at this poi

Re: [perl #53066] consting vtable methods

2008-04-19 Thread Mark Glines
looks to me > like a problem, not a solution. I agree. So I'm not blindly consting get_string() and hoping nothing breaks. Instead, I'm whining about it on RT and p2, and hoping the designers will say something useful. :) (Hopefully either: * "rip it all out, no vtable met

Re: [perl #53066] consting vtable methods

2008-04-19 Thread NotFound
Hello. > This is where I ran into problems. Is get_string constable? It seems > possible that someone somewhere would want to cache a stringification > that was computationally intensive, for later reuse. So now (as > bernhard kindly pointed out to me), this is starting to sound like a > d

[perl #53066] consting vtable methods

2008-04-19 Thread via RT
le? It seems possible that someone somewhere would want to cache a stringification that was computationally intensive, for later reuse. So now (as bernhard kindly pointed out to me), this is starting to sound like a design issue. Am I going down the wrong path here? If I can't consti

[perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2008-03-16 Thread James Keenan via RT
On Mon Mar 12 05:40:14 2007, [EMAIL PROTECTED] wrote: > I'm still working on my use case, but it appears the new MetaClass PMC > (src/pmc/metaclass.pmc) could use this vtable method as well; currently it > only has an add_attribute PMETHOD. > Alek, Are you still planning work on this patch? (No

Re: [perl #46731] [BUG] Can't super vtable methods ?

2007-10-22 Thread Allison Randal
Will Coleda wrote: The short-term hack for accessing the low-level PMC within the object is to grab the proxy object for that parent: $P4 = getattribute $P3, ['String'], 'proxy' $P4 = 'urk' urk indeed. Yah, I wouldn't have gotten that from reading PDD15. It's not part of the spec, an

Re: [perl #46731] [BUG] Can't super vtable methods ?

2007-10-22 Thread Will Coleda
On Oct 22, 2007, at 11:26 PM, Allison Randal wrote: Will Coleda (via RT) wrote: $ ./parrot foo.pir Method 'set_string_native' not found current instr.: 'test' pc 20 (foo.pir:8) We wanted to do this in Tcl to simplify TclConst, but were unable to. Presumably it's just that it's a vtable we'r

Re: [perl #46731] [BUG] Can't super vtable methods ?

2007-10-22 Thread Allison Randal
Will Coleda (via RT) wrote: $ ./parrot foo.pir Method 'set_string_native' not found current instr.: 'test' pc 20 (foo.pir:8) We wanted to do this in Tcl to simplify TclConst, but were unable to. Presumably it's just that it's a vtable we're trying to super, not a method... The problem here

[perl #46731] [BUG] Can't super vtable methods ?

2007-10-22 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #46731] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=46731 > $ cat foo.pir .sub test :main $P1 = get_class 'String' $P2 = subclass $P1, 'Goofy'

[perl #42969] [TODO] Remove deprecated vtable methods

2007-05-16 Thread via RT
# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #42969] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=42969 > In r18267, pre Parrot 0.4.11, Jonathan deprecated following :vtable meth

Re: [perl #41583] [PATCH] Tail calls from within vtable methods broken

2007-05-07 Thread Alek Storm
On 5/7/07, Bram Geron <[EMAIL PROTECTED]> wrote: Alek, I made the bulk of the patch before I dug through the other mails and saw your mail. I'm sorry if you were still planning on sending it. Don't feel sorry at all. I got halfway through the patch before I got distracted by other things.

[perl #41583] [PATCH] Tail calls from within vtable methods broken

2007-05-07 Thread Bram Geron
/* params signature pmc if it is non-const */ PMC *returns_signature; /* returns signature pmc if it is non-const */ Index: t/op/calling.t === --- t/op/calling.t (revision 18433) +++ t/op/calling.t (working c

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-12 Thread Alek Storm
I believe you're thinking of properties. I'll put together some sketch code with what I already have and post that. Thanks, Alek Storm On 3/5/07, chromatic <[EMAIL PROTECTED]> wrote: > On Sunday 04 March 2007 19:13, Alek Storm wrote: > > > In fact, these vtable method

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-04 Thread Alek Storm
orm wrote: > In fact, these vtable methods *encourage* the use of many languages in > a single application. For example, without these methods, programmers > have to be aware of the semantics of the Smalltalk object system and > use extra code when dealing with Smalltalk objects, breaki

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-04 Thread chromatic
On Sunday 04 March 2007 19:13, Alek Storm wrote: > In fact, these vtable methods *encourage* the use of many languages in > a single application. For example, without these methods, programmers > have to be aware of the semantics of the Smalltalk object system and > use extra code

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-04 Thread Alek Storm
Perl strings work differently than Python strings is cited as one of the reasons why Parrot is so useful for interoperating between languages, and the object system is a logical addition to this. In fact, these vtable methods *encourage* the use of many languages in a single application. For ex

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-04 Thread Joshua Isom
On Mar 4, 2007, at 12:40 PM, Alek Storm wrote: For the same reason we have set_attr, set_attr_str, get_attr, and get_attr_str, even though they're only used by ParrotObject - it allows for multiple, concurrent object systems. This goal is mentioned in PDD 15, in "What The Bytecode Sees". Why

Re: [perl #41583] Tail calls from within vtable methods broken

2007-03-04 Thread Alek Storm
I'm almost done with a different patch that preserves the parent context for the purpose of returning values into it. All further tailcalled contexts are freed as normal. That's pretty vague, but it's easier just to see the code. I just haven't had time to finish and release it. Thanks, Alek S

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-04 Thread Alek Storm
a RT) wrote: > > This patch adds the add_attr, rem_attr, and rem_attr_str vtable > methods. These will come in handy for Ruby's metaclasses or > Smalltalk's class objects. The only PMC currently affected by this is > ParrotClass, and the rem_attr and rem_attr_str methods are

Re: [perl #41583] Tail calls from within vtable methods broken

2007-03-04 Thread Jonathan Worthington
Bram Geron (via RT) wrote: Tail calls from within v-table methods are broken, the tail-called sub (or method) will not return correct values. When method A tailcalls sub B, B's set_returns stores its opcode number (and with it, which registers should be returned), but the low-level vtable code g

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-03-02 Thread Allison Randal
Alek Storm (via RT) wrote: This patch adds the add_attr, rem_attr, and rem_attr_str vtable methods. These will come in handy for Ruby's metaclasses or Smalltalk's class objects. The only PMC currently affected by this is ParrotClass, and the rem_attr and rem_attr_str methods

Re: [perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-02-27 Thread James E Keenan
Alek Storm wrote: # New Ticket Created by "Alek Storm" # Please include the string: [perl #41619] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41619 > This patch adds the add_attr, rem_attr, and rem_at

[perl #41619] [PATCH] add add_attr, rem_attr, and rem_attr_str vtable methods

2007-02-26 Thread Alek Storm
# New Ticket Created by "Alek Storm" # Please include the string: [perl #41619] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41619 > This patch adds the add_attr, rem_attr, and rem_attr_str vtable methods

[perl #41583] Tail calls from within vtable methods broken

2007-02-22 Thread via RT
# New Ticket Created by Bram Geron # Please include the string: [perl #41583] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41583 > --- osname= linux osvers= 2.6.18.3 arch= i486-linux-gnu-thread-multi cc= cc --- Flag

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-08-03 Thread Allison Randal
Bob Rogers wrote: > >There's no way to get full Continuations working around such C code > barriers, >except by *not* entering secondary runloops at all for these cases[1]. > This >could be achieved by (optionally) returning a new PC for all vtable/MMD >functions that is, by c

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-31 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Sun, 30 Jul 2006 21:58:36 +0200 Am Sonntag, 30. Juli 2006 04:50 schrieb Bob Rogers: > The attached patch detects cases where a continuation tries to enter a > runloop different from the one that is executing, and prints a warning >

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-30 Thread Leopold Toetsch
Am Sonntag, 30. Juli 2006 04:50 schrieb Bob Rogers: > The attached patch detects cases where a continuation tries to enter a > runloop different from the one that is executing, and prints a warning > to stderr. Looks very sane and appliable to me. Thanks, leo

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-30 Thread Bob Rogers
From: chromatic <[EMAIL PROTECTED]> Date: Sat, 29 Jul 2006 21:52:59 -0700 You should be able to replace this with pir_output_is( ..., todo => '...' ); Good idea; thank you. (I had forgotten about that syntax.) -- Bob

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-29 Thread chromatic
On Saturday 29 July 2006 19:50, Bob Rogers wrote: > +local $TODO = 'runloop shenanigans'; > +# stringification is handled by a vtable method, which runs in a second > +# runloop. when an error in the method tries to go to a Error_Handler > defined +# outside it, it winds up going to the inner runl

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-29 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Thu, 27 Jul 2006 20:50:18 +0200 Am Donnerstag, 27. Juli 2006 19:44 schrieb Matt Diephouse: > Running this gives: > >    caught >    No exception to pop. PIR code running on behalf of a vtable (or MMD) function is implemented

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-28 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Thu, 27 Jul 2006 20:50:18 +0200 Am Donnerstag, 27. Juli 2006 19:44 schrieb Matt Diephouse: > Running this gives: > >    caught >    No exception to pop. PIR code running on behalf of a vtable (or MMD) function is implemented

Re: [perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-27 Thread Leopold Toetsch
Am Donnerstag, 27. Juli 2006 19:44 schrieb Matt Diephouse: >    .sub __get_string :method >      $P0 = new .Exception >      throw $P0 >    .end > > Running this gives: > >    caught >    No exception to pop. PIR code running on behalf of a vtable (or MMD) function is implemented by entering a se

[perl #39988] [BUG] Exceptions + Vtable Methods

2006-07-27 Thread via RT
# New Ticket Created by Matt Diephouse # Please include the string: [perl #39988] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=39988 > The example: .sub main :main $P0 = get_hll_global ['Foo'], 'load' $P0()

Re: VTABLE methods and interfaces

2005-04-16 Thread Kevin Tew
Sam, Just wondering what the status is on python/parrot/pirate/pyrate. These both look outdated. http://www.intertwingly.net/stories/2004/10/05/pyrate.zip http://pirate.versionhost.com/viewcvs.cgi/pirate/ Is there a up to date cvs repo? Can we get this code checked into the parrot svn repo? Kevin T

Re: VTABLE methods and interfaces

2005-02-24 Thread Leopold Toetsch
Sam Ruby <[EMAIL PROTECTED]> wrote: > As long as find_method itself can be overridden, this above is merely a > description of the default behavior, not a hard requirement. Yes, of course. C *is* overridable and, as all method lookup is calling C, the code can do whatever is needed. I'm describin

Re: VTABLE methods and interfaces

2005-02-23 Thread Sam Ruby
"()# $x = ~$y string kontext This easily allows overloading of all the vtable methods. The PIC code gets even rid of the additional indirection as the function is called directly from opcodes. The vtable slots are just for calling these methods from within C source. As long as find_

VTABLE methods and interfaces

2005-02-23 Thread Leopold Toetsch
as methods, like now with the METHOD keyword. This allows eventually code like this: Px = Py."__pop_pmc"() or Px = Py."__string"()# $x = ~$y string kontext This easily allows overloading of all the vtable methods. The PIC code gets even rid of the additional

Re: [perl #31975] [PATCH] non-vtable methods on builtin pmcs

2004-10-14 Thread Leopold Toetsch
Sam Ruby <[EMAIL PROTECTED]> wrote: > How about: >METHOD INTVAL find(PMC* substr) { Sure, we need a return value ;) > Patch attached. Should the Object parameter be named "pmc" or "self"? Great. I'd say for consistency "pmc". > - Sam Ruby Thanks, applied. leo

[perl #31975] [PATCH] non-vtable methods on builtin pmcs

2004-10-13 Thread via RT
gt;>I'm not overly concerned about __init methods, in fact, my concern is >>the opposite: I'd like to solicit opinions on the viability of extending >>pmc2c2.pl to enable non-vtable methods to be defined, in C, in the .pmc >>file itself. > > That sounds great. >

Re: non-vtable methods on builtin pmcs

2004-10-13 Thread Leopold Toetsch
overriden directly. It could be useful that they first do their intended job and then call out to user code, if present. > I'm not overly concerned about __init methods, in fact, my concern is > the opposite: I'd like to solicit opinions on the viability of extending > pmc2c2.

non-vtable methods on builtin pmcs

2004-10-12 Thread Sam Ruby
hods won't get called. However, any subclasses will be aware of both the __init and regular methods. I've attached the test I produced. I'm not overly concerned about __init methods, in fact, my concern is the opposite: I'd like to solicit opinions on the viability of extend

Re: New vtable methods

2002-08-19 Thread Dan Sugalski
At 11:29 PM -0700 8/18/02, Brian Ingerson wrote: >On 18/08/02 16:06 -0400, Dan Sugalski wrote: >> Okay, here's two new vtable methods >> >> freeze(PMC) - Responsible for freezing a PMC to the current freeze >> data stream. Throws an exception on error >

Re: New vtable methods

2002-08-18 Thread Brian Ingerson
On 18/08/02 16:06 -0400, Dan Sugalski wrote: > Okay, here's two new vtable methods > >freeze(PMC) - Responsible for freezing a PMC to the current freeze > data stream. Throws an exception on error > >thaw(PMC) - A class method that thaws a PMC from the c

New vtable methods

2002-08-18 Thread Dan Sugalski
Okay, here's two new vtable methods freeze(PMC) - Responsible for freezing a PMC to the current freeze data stream. Throws an exception on error thaw(PMC) - A class method that thaws a PMC from the current thaw data stream Both of these should use the freeze/thaw API--I'l

Re: Vtable Methods in Parrot

2002-05-21 Thread Dan Sugalski
At 6:23 PM -0300 5/20/02, Daniel Grunblatt wrote: >On Mon, 20 May 2002, David M. Lloyd wrote: > >> What about subroutines? Are bsr & jsr the way it's gonna be or is there >> a rework in the works? > >docs/pdds/pdd03_calling_conventions.pod :) Ans I think I need to get that tidied up soon, as t

Re: Vtable Methods in Parrot

2002-05-20 Thread David M. Lloyd
#x27;ve looked it over but it doesn't say "Subroutines are called via bsr" or "Subroutines are called via vtable methods" or whatever. It seems just to talk about stack usage and so on. The regular expression PDD talks about using bsr to call into a regular expression. - D <[EMAIL PROTECTED]>

Re: Vtable Methods in Parrot

2002-05-20 Thread Daniel Grunblatt
On Mon, 20 May 2002, David M. Lloyd wrote: > What about subroutines? Are bsr & jsr the way it's gonna be or is there > a rework in the works? docs/pdds/pdd03_calling_conventions.pod :)

Re: Vtable Methods in Parrot

2002-05-20 Thread David M. Lloyd
On Mon, 20 May 2002, David M. Lloyd wrote: > Has anyone given any thought to this problem yet? > > Will we be able to do this or do we need a special vtable whose entries > automatically do a callback to Parrot? For that matter, what about calling C functions from Parrot? Loading PMCs dynamical

Vtable Methods in Parrot

2002-05-20 Thread David M. Lloyd
Has anyone given any thought to this problem yet? Will we be able to do this or do we need a special vtable whose entries automatically do a callback to Parrot? - D <[EMAIL PROTECTED]>

PMC vtable methods

2002-05-09 Thread Dan Sugalski
Okay, I'm working on redoing the vtable docs, since they're both deficient and decaying. A question came up a while back about what to do with P1 in an opcode such as: add P1, P2, P3 And the answer is that opcode function looks like: p1->vtable->assign_pmc(p1, p2->vtable->add_pm

Re: autogenerating some vtable-methods

2002-02-03 Thread Steve Fink
On Sun, Feb 03, 2002 at 09:29:27PM +0100, Juergen Boemmels wrote: > Hi there, > > I played again a little with the vtables. > I noticed that all *.pmc function implement the methods type and name > are implemented the same way. Then I was wondering if its possible to > autogenerate this functions

autogenerating some vtable-methods

2002-02-03 Thread Juergen Boemmels
Hi there, I played again a little with the vtables. I noticed that all *.pmc function implement the methods type and name are implemented the same way. Then I was wondering if its possible to autogenerate this functions in the pmc2c.pl This patch implements autogeneration of this functions, and

Re: New PMC vtable methods

2002-01-30 Thread Dan Sugalski
At 11:40 PM + 1/30/02, Nicholas Clark wrote: >On Wed, Jan 30, 2002 at 06:23:43PM -0500, Dan Sugalski wrote: >> We're adding the following: >> >> INTVAL get_character(PMC *, INTVAL) >> INTVAL get_character(PMC *, KEY *, INTVAL) >> >> to return the character at position INTVAL in the p

Re: New PMC vtable methods

2002-01-30 Thread Nicholas Clark
On Wed, Jan 30, 2002 at 06:23:43PM -0500, Dan Sugalski wrote: > We're adding the following: > >INTVAL get_character(PMC *, INTVAL) >INTVAL get_character(PMC *, KEY *, INTVAL) > > to return the character at position INTVAL in the passed in PMC. are characters really INTVAL? I have this g

New PMC vtable methods

2002-01-30 Thread Dan Sugalski
We're adding the following: INTVAL get_character(PMC *, INTVAL) INTVAL get_character(PMC *, KEY *, INTVAL) to return the character at position INTVAL in the passed in PMC. -- Dan --"it's like this"

Re: Vtable methods

2001-01-04 Thread Dan Sugalski
At 12:42 PM 1/4/01 +, Simon Cozens wrote: >It's time to design the RTL and API. Can I have suggestions for vtable >methods, please? I can go you one better--I've a partial vtable PDD done. I'll patch it up a bit when I get into the office later and send it on. One thi

Vtable methods

2001-01-04 Thread Simon Cozens
It's time to design the RTL and API. Can I have suggestions for vtable methods, please? -- In related wibbling, I can see an opening for the four lusers of the Apocalypse... "I didn't change anything", "My e-mail doesn't work", "I can't print&quo