Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Michele Dondi
On Wed, 15 Dec 2004, Abhijit Mahabal wrote: #!/usr/bin/perl -e $x = 1; Is this supposed to work? I would tend to consider it counter intuitive... #!/usr/bin/perl v6; $x = 1; Incidentally, and on a totally OT basis, I've noticed that Perl6 is supposed to have v-strings. But (current) 'perldoc perld

Re: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-16 Thread Ed Allen Smith
In message <[EMAIL PROTECTED]> (on 16 December 2004 16:45:01 +1100), [EMAIL PROTECTED] (Andrew Savige) wrote: >Steve Hay wrote: >> is even worse: 1 second again on 5.8.6/perl-malloc versus 56 >> seconds on 5.8.4/system-malloc! > >I'm pretty sure realloc() is the culprit here. >A common trick used b

Re: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-16 Thread Michael G Schwern
On Thu, Dec 16, 2004 at 12:03:52PM -, Orton, Yves wrote: > > Perhaps you've got a damaged default MANIFEST.SKIP. Check what > > "perldoc -m ExtUtils::MANIFEST.SKIP" looks like. It should > > look like this. > > > http://search.cpan.org/src/MSCHWERN/ExtUtils-MakeMaker-6.24/lib/ExtUtils/MAN >

Re: cvs commit: parrot/ops pmc.ops

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby <[EMAIL PROTECTED]> wrote: I don't understand this. At all. But the test case added to pyclass.t (motivated by test 4 in pie/b3.t) only passes if this change to the get_repr op is made. [ ... ] -op get_repr(out STR, in PMC) { -$1 = $2->vtable->get_repr(int

RE: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-16 Thread Orton, Yves
> Not Test::More's MANIFEST.SKIP. The system's default MANIFEST.SKIP. > ExtUtils::MANIFEST.SKIP. > > Run "perldoc -m ExtUtils::MANIFEST.SKIP" and see if it looks like either of > the urls above. Ah, sorry. I didnt understand. Im just curious if i alter this file this will affect all "make dist"

Re: overloaded operator calling conventions

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: A few observations, first from an Parrot Internal perspective... in general, the code for the opcodes tend to do things like the following: $1->vtable->get_string(interpreter, $1) Note that the object tends to be repeated as the first argument. It often th

Re: cvs commit: parrot/ops pmc.ops

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: Leopold Toetsch wrote: +inline op get_repr(out STR, in PMC) { +STRING *s = $2->vtable->get_repr(interpreter, $2); +$1 = s; goto NEXT(); } Strange. Stranger. Strangest. Did the test fail with JIT/i386 only? I didn't mean to commit the "inline

Re: cvs commit: parrot vtable.tbl

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: My need is to be able to call add_method for methods defined as @ANON. This doesn't make sense to me. The @ANON pragma avoids the add_method (or store_global) call in the first place. From the perspective of Parrot, namespaces should be viewed a perfectly reasonable mechanism fo

Re: cvs commit: parrot/ops pmc.ops

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Before this line is executed, (gdb) p interpreter->ctx.bp $1 = (struct parrot_regs_t *) 0x40b6bd88 After the above line is executed: (gdb) p interpreter->ctx.bp $2 = (struct parrot_regs_t *) 0x40b6bae8 Then is obviously your implementation of get_repr broken. Two questions c

Re: New qa.perl.org updates

2004-12-16 Thread Ovid
--- Andy Lester <[EMAIL PROTECTED]> wrote: > > Patches, please. s/html$/pod/ in the URL for the source. Sorry. I should have gotten these out sooner. I was sidetracked. I've attached patches to add Test::MockModule to the module list and to add the "use_ok() or die" wording to the testing gui

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Larry Wall
On Fri, Dec 10, 2004 at 11:05:32AM -0500, Abhijit Mahabal wrote: : Consider a class (e.g., the hypothetical Geometry::Triangle) that can : have several attributes (side1, side2, side3, angle1, ang_bisector1, : side_bisector, altitude1 and so forth), most of which will not be : needed for most i

Re: cvs commit: parrot vtable.tbl

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: My need is to be able to call add_method for methods defined as @ANON. This doesn't make sense to me. The @ANON pragma avoids the add_method (or store_global) call in the first place. I don't want the method added to a namespace, or stored as a global. I wa

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Abhijit Mahabal
Larry Wall wrote: On Fri, Dec 10, 2004 at 11:05:32AM -0500, Abhijit Mahabal wrote: : Consider a class (e.g., the hypothetical Geometry::Triangle) that can : have several attributes (side1, side2, side3, angle1, ang_bisector1, : side_bisector, altitude1 and so forth), most of which will not be :

Re: Context, wrappers, and rules

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Leopold Toetsch wrote: Only function calls / returns may change the context. A simple opcode like get_repr isn't allowed to do that. The question isn't about what opcodes are or are not allowed to do. The question is what VTABLE_* functions are or are not allowed to do. Can V

runops_args vs NCI

2004-12-16 Thread Sam Ruby
pseudo-code for runops_args: runops_args(PMC* sub, char* sig, va_list ap) { dest = VTABLE_invoke(interpreter, sub, NULL); REG_*[*] = ap[*], as appropriate if (dest) runops } However, VTABLE_invoke on NCI methods is where the "real work" is done (including reading from and writing t

Re: Context, wrappers, and rules

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Parrot_PyClass_get_repr is one such wrapper. How could it be done better? If you make a specific suggestion there, I'll either adopt it or produce a test case as a counter example. You'd need in pyclass.pmc: PMC* get_repr() { return pmc_new_string( ... "") } Ju

Re: Context, wrappers, and rules

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: On the other hand, if runops can't change the context, then why is runops_args careful to capture the context prior to calling runops? C is a low-level function that awaits all properly setup. Around that are more function that e.g. create a return continuation and do argu

Re: Objects, classes, metaclasses, and other things that go bump in the night

2004-12-16 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 11:13 AM +0100 12/14/04, Leopold Toetsch wrote: >>Dan Sugalski <[EMAIL PROTECTED]> wrote: >> >>> subclass - To create a subclass of a class object >> >>Is existing and used. > > Right. I was listing the things we need in the protocol. Some of the

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Smylers
David Storrs writes: > On Dec 15, 2004, at 6:11 PM, Abhijit Mahabal wrote: > > > S01 says: > > > > # Perl 5 code is not strict by default, while Perl 6 code is. But it > > should be easy to relax with -e or maybe even a bare version number: > > this would suck. Badly. > > We should not be opt

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Larry Wall
On Thu, Dec 16, 2004 at 10:42:35AM +0100, Michele Dondi wrote: : On Wed, 15 Dec 2004, Abhijit Mahabal wrote: : : >#!/usr/bin/perl -e : >$x = 1; : : Is this supposed to work? I would tend to consider it counter intuitive... It occurred to me as I was dropping off to sleep last night that it can't

Re: cvs commit: parrot vtable.tbl

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: This doesn't make sense to me. The @ANON pragma avoids the add_method (or store_global) call in the first place. I don't want the method added to a namespace, or stored as a global. I want it stored as a property of a class object. I presumed that ;) Well, due to the described p

[CVS ci] class autoload

2004-12-16 Thread Leopold Toetsch
1) There is a new opcode new Px, Sc: new P0, "PyInt" 2) If the given class doesn't yet exist, Parrot_autoload_class is called which has hardcode mapping for "Py" => "python_group", "Tcl" => "tcl_group". A bit hackish but working ... 3) The pybuiltin.__load__() function is automatically called

Re: overloaded operator calling conventions

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Luke Palmer <[EMAIL PROTECTED]> wrote: Leopold Toetsch writes: Why do we have the special notion of current_object in the first place? Why not just pass all in as P5, P6, ...? I agree that this is the way to go. Especially if we have some marker somewhere that tells us that

Re: overloaded operator calling conventions

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: A few observations, first from an Parrot Internal perspective... in general, the code for the opcodes tend to do things like the following: $1->vtable->get_string(interpreter, $1) Note that the object tends to be repeated as the first argument. It often the case that the first a

Re: cvs commit: parrot/ops pmc.ops

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Leopold Toetsch wrote: +inline op get_repr(out STR, in PMC) { +STRING *s = $2->vtable->get_repr(interpreter, $2); +$1 = s; goto NEXT(); } Strange. Stranger. Strangest. Did the test fail with JIT/i386 only? I didn't mean to commit the "inline" portion of the chan

Re: [CVS ci] class autoload

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: 1) There is a new opcode new Px, Sc: new P0, "PyInt" 2) If the given class doesn't yet exist, Parrot_autoload_class is called which has hardcode mapping for "Py" => "python_group", "Tcl" => "tcl_group". A bit hackish but working ... Perhaps longer term, a change to the p

Re: overloaded operator calling conventions

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Leopold Toetsch wrote: class_self."__super"(args) so again the invocant is the first argument after interpreter. Believe it or not, I think we are agreeing. *g* To invoke a method on an object using Parrot Calling Conventions, P2 needs to be the object used for dispatch purposes

Re: [CVS ci] class autoload

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Developers could declare such a dependency with a IMCC macro, something like this: .lib python_group That could be .class_mapping "Py", "python_group" OTOH when the classes are built in dynclasses, we can as well hard-code the entries. We'll see. This would enable JITs to

Re: cvs commit: parrot vtable.tbl

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: Leopold Toetsch wrote: cvsuser 04/12/15 02:36:29 Modified:.vtable.tbl Log: stub in object vtables [snip] +void add_parent(PMC* parent) +void become_parent(PMC* class) +INTVAL class_type() +void add_method(STRING* method) +void r

Context, wrappers, and rules (was: cvs commit: parrot/ops pmc.ops)

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: Before this line is executed, (gdb) p interpreter->ctx.bp $1 = (struct parrot_regs_t *) 0x40b6bd88 After the above line is executed: (gdb) p interpreter->ctx.bp $2 = (struct parrot_regs_t *) 0x40b6bae8 Then is obviously your implementation of get_repr

Re: cvs commit: parrot vtable.tbl

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Python classes are not namespaces. Nor are they global. They are dictionaries. Or, the view is a dictionary-like. The dict is CPython's implementation. I can imagine that Parrot's class namespaces work as well. Are namespaces subject to garbage collection? Classes may be

RE: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-16 Thread Orton, Yves
> Perhaps you've got a damaged default MANIFEST.SKIP. Check what > "perldoc -m ExtUtils::MANIFEST.SKIP" looks like. It should > look like this. > > http://search.cpan.org/src/MSCHWERN/ExtUtils-MakeMaker-6.24/lib/ExtUtils/MAN IFEST.SKIP > > Not like this. > http://search.cpan.org/src/MSCHWERN/E

Re: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-16 Thread Michael G Schwern
On Thu, Dec 16, 2004 at 12:59:00PM -, Orton, Yves wrote: > Ah, sorry. I didnt understand. Im just curious if i alter this file this > will affect all "make dist" commands? Only if that module doesn't have its own MANIFEST.SKIP. > Is there any chance the default could have ".bak" added in fu