Re: PCC and IMC

2003-10-12 Thread Luke Palmer
Gregor N. Purdy writes: Leo -- The Jako compiler spits stuff out from Perl. I'm writing some new experimental stuff in PIR directly. I'm curious about other stuff, too. I don't see any of the languages/imcc/t/**/*.t files doing anything with the ord op, and when I try to use it as

Re: PCC and IMC

2003-10-12 Thread Luke Palmer
, input, 0, 1 Luke (Note that the complaint about ord_i_p is on the substr line, and its as if it thinks input is a PMC not a string. Regards, -- Gregor On Sun, 2003-10-12 at 12:15, Luke Palmer wrote: Gregor N. Purdy writes: Leo -- The Jako compiler spits stuff

Re: How to create a function that returns nothing

2003-10-14 Thread Luke Palmer
Joe Gottman writes: How do you declare a function that doesn't return anything? For instance, a C++ swap function might be declared template class X void swap(X x, X y); It would be nice to declare the corresponding Perl6 function as sub swap ($x is rw, $y is rw) returns nothing

Re: Instantiating objects

2003-10-15 Thread Luke Palmer
Leopold Toetsch writes: I think that for supporting Ruby or such we have to keep fences between PMCs and real objects very low. Agreed, or have some sort of automagic transformation possible. So it should be possible to define an Imaginary Number class that inherits from two (Perl?)Nums

Re: Lexical Pads

2003-10-18 Thread Luke Palmer
Will Coleda writes: Can someone explain to me the lexical pad stack and static nesting depth? I'm trying to write global for tcl, and trying to pull out a variable from the outermost pad, and failing to find it. - I'm fairly certain this is because I'm abusing new_pad and store_lex

Alternately named arguments

2003-10-24 Thread Luke Palmer
Presuming you can do: (who = $name, why = $reason) := (why = $because, who = me); (from A6) Does that imply that you can do: sub routine (name = $nombre, date = $fecha) {...} Anyway, I just realized that this is finally an elegant way to do multiple, unordered return values:

Re: Alternately named arguments

2003-10-25 Thread Luke Palmer
David Storrs writes: On Fri, Oct 24, 2003 at 12:57:18AM -0600, Luke Palmer wrote: Presuming you can do: (who = $name, why = $reason) := (why = $because, who = me); (from A6) Does that imply that you can do: sub routine (name = $nombre, date = $fecha

Re: Alternately named arguments

2003-10-26 Thread Luke Palmer
Hi Damian, welcome back! Damian Conway writes: Luke Palmer asked: Presuming you can do: (who = $name, why = $reason) := (why = $because, who = me); (from A6) Does that imply that you can do: sub routine (name = $nombre, date = $fecha) {...} If we're consistent about

Garbage-collecting classes [was: This week's Summary]

2003-10-28 Thread Luke Palmer
Object Instantiation Dan had a moment of clarity and declared that the Parrot Way to instantiate an object in class Foo will be: new P5, .Foo All we need now is a working implementation. And, apparently, knowing what class a class is a member of might be handy,

Re: Some questions about currying

2003-10-29 Thread Luke Palmer
Joe Gottman writes: I just reread the section of A6 about currying, and I have several questions about it. 1) Suppose I have a function like the following: sub foo($param, @param) {...} where the parameter names differ only by their sigils. Is it legal for me

Nested modules

2003-11-02 Thread Luke Palmer
So, we can have :: in names, but that doesn't represent any inherent relationship between the module before the :: and the one after. I think this is an important thing to keep. However, will it be possible to, for example, do: module Foo; module Bar { ... } And refer to the inner

Re: Vector dot Vectoria

2003-11-05 Thread Luke Palmer
Hi Doug, Doug McNutt writes: The first source of discussion was around whether there is any consistent meaning to array operations. The source of this was that some felt that other people may want C* to mean something other than element-wise multiplication by default (e.g. matrix inner

Re: How to run typeless languages fast on parrot?

2003-11-05 Thread Luke Palmer
Thies C. Arntzen writes: hi, we've started a project (will have a web-page soon) that aims to port the php-language (www.php.net) to run on top of parrot. Cool! we've written some initial code and i'm kinda stuck while writing the codegen (i target imc)

Re: syntax: multi vs. method

2003-11-18 Thread Luke Palmer
Jonathan Lang writes: My apologies for the break in the chain of responses; I lost your reply before I could reply to it, and had to retrieve it from the list archives. Luke Palmer wrote: Well, multi is no longer a declarator in its own right, but rather a modifier. Synopsis Exegesis

Control flow variables

2003-11-18 Thread Luke Palmer
I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. Here's the code, Perl6ized: ... ; my $is_ok = 1; for 0..6 - $t { if abs(@new[$t] - @new[$t+1]) 3 { $is_ok = 0;

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Simon Cozens writes: [EMAIL PROTECTED] (Luke Palmer) writes: I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. The code in question got me thinking too; I wanted to find a cleaner way to write

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: Luke Palmer wrote: I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. Here's the code, Perl6ized: ... ; my $is_ok = 1; for 0..6 - $t { if abs

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:06 PM To: [EMAIL PROTECTED] Subject: Re: Control flow variables On Tuesday, November 18, 2003, at 06:38 AM, Simon Cozens wrote: Given that

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:06 PM To: [EMAIL PROTECTED] Subject: Re: Control flow variables On Tuesday, November 18, 2003, at 06:38 AM, Simon Cozens wrote: Given that

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Damian Conway writes: Luke Palmer started a discussion: I see this idiom a lot in code. You loop through some values on a condition, and do something only if the condition was never true. $is_ok is a control flow variable, something I like to minimize. Now, there are other ways to do

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: From: Luke Palmer [mailto:[EMAIL PROTECTED] Austin Hastings writes: From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Would that then imply that sub blah { ... # 1 return if $a;# 2

Re: syntax: multi vs. method

2003-11-18 Thread Luke Palmer
Larry Wall writes: If you write: multi method add( $self: Foo $foo, Bar $bar ); then there are multiple add methods in the current class. Note the invocant is not optional in this case. Also, there's an implied second colon after $bar, indicating the end of the arguments to be

Re: Control flow variables

2003-11-19 Thread Luke Palmer
Jonathan Scott Duff writes: On Tue, Nov 18, 2003 at 11:37:22PM +0100, Seiler Thomas wrote: So... lets call a function instead: my $is_ok = 1; for 0..6 - $t { if abs(@new[$t] - @new[$t+1]) 3 { $is_ok = 0; last; } } if

Re: Control flow variables

2003-11-19 Thread Luke Palmer
Piers Cawley writes: All of which means you can wrap it up in a macro and prove Simon's point about what's syntax and what's CP6AN: macro unless_all( Block test is parsed /perl.expression/, Block consequence, [EMAIL PROTECTED] ) { my $guard = Object.new;

Re: Control flow variables

2003-11-19 Thread Luke Palmer
Gordon Henriksen writes: Larry Wall wrote: On Tue, Nov 18, 2003 at 06:28:59PM -0500, Gordon Henriksen wrote: my @b = for @a - $_ { ... } That will be a syntax error. Generators are too mind-stretching to inflict on novices [...] I making the point that

Re: Parsing macros (was: Control flow variables)

2003-11-20 Thread Luke Palmer
Jonathan Lang writes: Larry Wall wrote: So far we've only allowed is parsed on the macro itself, not on individual arguments. Still, that's an interesting idea. Forgive me if this has already been addressed, but this could have some useful applications: So far, everything I've read

Re: Control flow variables

2003-11-20 Thread Luke Palmer
Jonathan Scott Duff writes: On Wed, Nov 19, 2003 at 12:49:21PM -0800, Larry Wall wrote: Sorry, I wasn't being very clear. It wouldn't be logically attached to the outside of the for, but to the inside of the confer, or whatever: @foo = gather { for @a - $x { pick $x if

Re: s/// in string context should return the string

2003-11-22 Thread Luke Palmer
David Chan writes: Hmmm. When doing multiple substitutions, it would be nice to avoid a hard-to-read nested function call which reads backwards, a la python: return re.sub('','gt;',re.sub('','lt;',re.sub('','amp;',text))) ... but to also avoid multiple statements like this: my $tmp

'catch' statement modifier

2003-11-23 Thread Luke Palmer
I was reading over some code that used the MIDI module, and saw the Cwrite_to_file method. I began wondering, how does one report the error if he feels like it, but let the module report the error if not, in a concise way. What about something along the lines of a Ccatch statement modifier,

Re: 'catch' statement modifier

2003-11-24 Thread Luke Palmer
Damian Conway writes: Hmm. I think I may have missed Luke's point. Which was (presumably): what if C$opus.write_to_file($file); validly returns Cundef? In which case I think we just fall back to: try{$opus.write_to_file($file); CATCH {die Couldn't write to $file: $!}}

The C Comma

2003-11-24 Thread Luke Palmer
Honestly you guys, I'm not trolling. I'm just getting a lot of ideas recently. :-) The C comma has always bugged me, but its function is indeed useful (many times I use Cand in its place, if I know the left side will always be true). I don't know whether it's staying or not (I've heard rumors of

Re: Control flow variables

2003-11-25 Thread Luke Palmer
Piers Cawley writes: Simon Cozens [EMAIL PROTECTED] writes: But it isn't, and I don't know why it isn't, and so we end up spending loads of time discussing things that can be punted out to modules. Designing Perl 6 is hard enough; let's not try to fill CP6AN at the same time. But the

Re: The C Comma

2003-11-25 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Adam Turoff [mailto:[EMAIL PROTECTED] On Tue, Nov 25, 2003 at 01:03:19PM +1100, Damian Conway wrote: Schwern observed: Perhaps this is yet another argument for insisting on: while do {$n++; $foo $bar}

Properties

2003-11-27 Thread Luke Palmer
Here's a series of questions/confirmation requests about how properties work (but specifically run-time properties, not traits): Use Cbut to assign a property to a Ivalue: $a = $b but foo; # $a has property foo, $b does not Properties are just out-of-band methods: if $x.foo {

Re: Properties

2003-11-29 Thread Luke Palmer
Paul Hodges writes: Larry Wall writes: Perl 5 didn't allow exportation of lexicals because typeglobs only dealt with package variables, not lexical variables. In Perl 6 we'll be able to alias both lexicals and package variables. That implies that a lexically scoped name can be exported,

Re: Properties

2003-12-01 Thread Luke Palmer
Hodges, Paul writes: I assume you're setting the the value, so I think I understand it, but how about sub setvals ($o, [EMAIL PROTECTED]) { $o but= $_; $o.$_ = true; } Though I'm still iffy about that $o.$_ business. I think $_(true) is better.

Re: OP [was: Re: Properties]

2003-12-02 Thread Luke Palmer
Michael Lazzaro writes: On Monday, December 1, 2003, at 01:05 PM, Hodges, Paul wrote: Didn't know is would do that. Good to know! And in my meager defense, I did reference MikeL's operator synopsis as of 3/25/03, which said ^[op] might be a synonym for or (Sorry, no fancy chars here.

Re: OP [was: Re: Properties]

2003-12-02 Thread Luke Palmer
Luke Palmer writes: And as far as I know, and are exactly equivalent to and in all cases. By which I mean and , of course. :-/ (mutt is kind of a pain in this area) Luke

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-04 Thread Luke Palmer
Hodges, Paul writes: How about use Baz; # assume object type my property foo; my @bar of Baz is false but foo; # maybe not what you meant? Definitely not what you meant. Fortunately, the compiler will teach you a thing or two about it: Cfalse is not a trait. But indeed foo would

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-04 Thread Luke Palmer
Paul Hodges writes: Luke Palmer: Something likely more like: my role property_wrap[Property [EMAIL PROTECTED] { method STORE($newval) { SUPER::STORE($newval but [EMAIL PROTECTED]) } } @bar but= property_wrap[false, foo]; ...square brackets? ...roles can have

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-05 Thread Luke Palmer
Jonathan Scott Duff writes: On Thu, Dec 04, 2003 at 05:57:52PM -0700, Luke Palmer wrote: Hodges, Paul writes: I'd *like* to be able to predeclare a trait or property to be distributed across any values placed in this array, but only this array. For example, it would be nice if I could

Re: Missing branch instructions?

2003-12-08 Thread Luke Palmer
Pete Lomax writes: I'm not convinced at all here. PMC comparison ops, afaict, are based solely on the pmc instance/address Here's a snippet to play with: $P1 = new Array $P1 = 2 $P1[0] = 1 $P1[1] = 1 $P2 = new Array $P2 = 2 $P2[0] = 1

Re: Incorrect scoping of constants in IMCC

2003-12-09 Thread Luke Palmer
Pete Lomax writes: There's no file level locals yet either ;-) Can I ask a stupid question? Guess I'm going to anyway... Is there much benefit to .const, over sticking a value in a register and not modifying it? (which is what I've done to get round this) Yes. First, if you want more

Re: [CVS ci] object stuff

2003-12-10 Thread Luke Palmer
Dan Sugalski writes: At 05:14 PM 12/5/2003 +0100, Leopold Toetsch wrote: set I2, P1[Foo\x00i] # I1 == I2 gets currently the attribute idx (0) of $Foo::i. Q: Should the assembler mangle the Foo::i to Foo\0i I don't like it either, but the alternative is to impose an external

Re: enums and bitenums

2003-12-11 Thread Luke Palmer
Larry Wall writes: Anyway, this all implies that use of a role as a method name defaults to returning whether the type in question matches the subtype. That is, when you say $foo.true it's asking whether the Boolean property fulfills the true constraint. When you say $bar.red

Vocabulary

2003-12-12 Thread Luke Palmer
So I'm seeing a lot of inconsistent OO-vocabulary around here, and it makes things pretty hard to understand. So here's how Perl 6 is using said inconsistent terms, AFAIK: - attribute A concrete data member of a class. Used with Chas. - property An out-of-band sticky note

Re: Roles and Mix-ins?

2003-12-13 Thread Luke Palmer
Chris Shawmail (E-mail) writes: I'm still digesting the vocabulary thread, but while I do, let me ask a question that's probably crystal clear to everyone else. Do roles act as a form of mix-in, as Ruby modules may, and Objective-C protocols do? Would the following two snippets be at all

Re: enums and bitenums

2003-12-13 Thread Luke Palmer
Andy Wardley writes: Larry Wall wrote: Well, we can't use - because we're using that for something else. But it's certainly true that we'll have to have some mechanism for disambiguating Color.green from Blackberry.green. After all, Blackberry.green == Color.red Or maybe it's

Re: This week's summary

2003-12-16 Thread Luke Palmer
Piers Cawley writes: The Perl 6 Summarizer [EMAIL PROTECTED] writes: Vocabulary If you're even vaguely interested in the workings of Perl 6's object system, you need to read the referenced post. Luke Palmer, worrying about people using Object related vocabulary

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Michael Lazzaro writes: On Sunday, December 14, 2003, at 06:14 PM, Larry Wall wrote: But the agreement could be implied by silence. If, by the time the entire program is parsed, nobody has said they want to extend an interface, then the interface can be considered closed. In other words,

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Chip Salzenberg writes: According to Jonathan Scott Duff: Those classes that are closed can be opened at run-time and the user pays the penalty then when they try to modify the class [...] The optimization that can be reversed is not the true optimization. While poetic and concise, I

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Larry Wall writes: On Tue, Dec 16, 2003 at 07:05:19AM -0700, Luke Palmer wrote: : Michael Lazzaro writes: : : On Sunday, December 14, 2003, at 06:14 PM, Larry Wall wrote: : But the agreement could be implied by silence. If, by the time the : entire program is parsed, nobody has said

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Michael Lazzaro writes: I agree, it is frequently the case that the question of speed is made critical by people who most assuredly do not need it. But they still decide that way, and I have found that asserting to them that speed is not important has been... well, less than effective. I

Re: but true

2003-12-19 Thread Luke Palmer
Abhijit A. Mahabal writes: On Fri, 19 Dec 2003, Larry Wall wrote: On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : Of course, when I do: : : my $x = 0 but (true|false); : : then what happens? That's the problem with making them methods. Any such operational

Re: Object Order of Precedence (Was: Vocabulary)

2003-12-19 Thread Luke Palmer
Larry Wall writes: But if you say something like: class DangerousPet does Pet does Predator { multi method feed ($x) {...} } then DangerousPet::feed is called only when multimethod dispatch would have thrown an exception. Alternately, multi's will probably have some way

Re: [perl] Re: Object Order of Precedence (Was: Vocabulary)

2003-12-20 Thread Luke Palmer
Joe Gottman writes: - Original Message - From: Jonathan Lang [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 20, 2003 3:41 PM Subject: [perl] Re: Object Order of Precedence (Was: Vocabulary) Larry Wall wrote: If DangerousPet doesn't define a feed method at

Re: Nature of traits

2003-12-21 Thread Luke Palmer
Jonathan Lang writes: I've just been rereading the recent discussions, and I noticed something that I missed the first time: Larry Wall wrote: Traits are not definitional but rather operationally defined in the worst way. That's why traits are renegade roles. They don't play by the

Re: When is enough too much?

2003-12-23 Thread Luke Palmer
Uri Guttman writes: good point. but we definitely would want arrays supported with all three scalar types and in both directions. in fact, if we just look at what swig (and other similar projects) is able to do we can make that stuff easier as well. i recall a minor nightmare when we tried to

Re: ParrotIO array

2003-12-24 Thread Luke Palmer
Leopold Toetsch writes: Pete Lomax wrote: My question is: What can I do to P4 entries to mark them as available for re-use? close: P0=P4[I1] close P0 # mark slot as free null P5 P4[I1]=P5# set to NULL ret you can test the entry by: set P0, P4[I1]

[PATCH] internal_exception newlines

2003-12-24 Thread Luke Palmer
Here's a big patch that adds newlines to all internal_exception calls for which they were missing. Luke Index: classes/delegate.pmc === RCS file: /cvs/public/parrot/classes/delegate.pmc,v retrieving revision 1.8 diff -u -r1.8

[PATCH] supplant op

2003-12-24 Thread Luke Palmer
Here's that op that replaces the header of one PMC with another's, if people are interested. Luke Index: ops/ops.num === RCS file: /cvs/public/parrot/ops/ops.num,v retrieving revision 1.15 diff -u -r1.15 ops.num --- ops/ops.num 10

Re: [PATCH] supplant op

2003-12-24 Thread Luke Palmer
Leopold Toetsch writes: Luke Palmer [EMAIL PROTECTED] wrote: Here's that op that replaces the header of one PMC with another's, if people are interested. +inline op supplant(in PMC, in PMC) { +*$1 = *$2; Brrr. I'm not willing to contemplate now on the nasty side effects

Re: [PATCH] supplant op

2003-12-25 Thread Luke Palmer
Leopold Toetsch writes: Luke Palmer [EMAIL PROTECTED] wrote: ... I think a Ref would work, but Ref delegates set_pmc to what it's referencing, so it's never possible to change the referent! Is it? Some time ago I proposed additional opcodes dealing with Ref PMCs. You mention it, yep

Re: Very large runtime overhead for prototyped functions

2003-12-27 Thread Luke Palmer
Joe Wilson writes: Using a recursive version of the fibonacci function (with the integer 32 as an argument) to test function call overhead I get these timings for various languages and configurations: perl 5.6.1fib.pl 10.93 seconds python 2.2.2 fib.py6.76 seconds parrot

Re: Slow vararg subroutines in Parrot, jit bug found as well.

2003-12-27 Thread Luke Palmer
Joe Wilson writes: Dan Sugalski: 2) Parrot's Array and SArray values all accept mixed-type data, which perl's arrays do *not* do, and as such have some extra speed hits that perl arrays don't. What do you mean? Perl's arrays do indeed accept mixed data types (see example below). No,

IMCC bug: newclass optimized away

2003-12-31 Thread Luke Palmer
Both newclass and addattrib are optimized away by the 'used_once' optimization under -O2. This is obviously incorrect, since they have side-effects. Luke

Object system

2003-12-31 Thread Luke Palmer
Since I'm working on a compiler that requires objects, and seeing as how we have a python compiler now hanging over our heads, what work is necessary to finish up the object system? I notice that ParrotObject only has [get|set]_integer_keyed. I assume we intend to make those for the rest of the

Re: Threads Design. A Win32 perspective.

2004-01-03 Thread Luke Palmer
Nigel Sandever writes: Maybe it would be possible (for me + others) to write the core of a win32 specific, threaded VM interpreter that would take parrot byte code and run it. Thereby, utilising all the good stuff that preceeds the VM interpreter, plus probably large chunks of the parrot VM,

newclass bug, or something

2004-01-05 Thread Luke Palmer
The following program segfaults after 510 iterations: .sub _main $I0 = 0 again: $S1 = anon $S0 = $I0 inc $I0 concat $S1, $S0 newclass $P0, $S1 find_type $I2, $S1 print $I2 print \n if $I0 1000 goto again

[PATCH] The Return of the Priority DOD

2004-01-05 Thread Luke Palmer
After many months of lying dormant, I figured I'd get my act together and adapt this patch to the few recent modifications. And this time, I'm posting a benchmark! My results get about 5% slowdown in the eager case, and the usual 10,000% speedup in the lazy case. Luke First, the benchmark

Re: [PATCH] The Return of the Priority DOD

2004-01-05 Thread Luke Palmer
Jeff Clites writes: On Jan 5, 2004, at 5:47 AM, Luke Palmer wrote: After many months of lying dormant, I figured I'd get my act together and adapt this patch to the few recent modifications. And this time, I'm posting a benchmark! My results get about 5% slowdown in the eager case

Re: Roles and Mix-ins?

2004-01-06 Thread Luke Palmer
David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote: : For one, one role's methods don't silently override another's. Instead, : you get, er, role conflict and you have to disambiguate yourself

Minor IMCC bug with -v

2004-01-06 Thread Luke Palmer
Looks like when I run parrot -v, the statistics report on each sub, but it calls all the subs the same thing, in particular, the last sub compiled. Luke

Continuations don't close over register stacks

2004-01-06 Thread Luke Palmer
Aren't continuations supposed to close over the register stacks? In this code: .sub _main I17 = 42 savetop newsub P0, .Continuation, second restoretop invoke P0 second: restoretop print I17 print \n end .end I

Re: References to hash elements?

2004-01-06 Thread Luke Palmer
Simon Cozens writes: $a = $hash{bar}; Here you used the copy constructor before taking the reference. It might look like an assignment operator, but it isn't. You're better off thinking that assignment doesn't exist. It's a copy constructor. It makes the PMC referred to by $a a copy of the

Re: References to hash elements?

2004-01-06 Thread Luke Palmer
Arthur Bergman writes: On 6 Jan 2004, at 17:05, Simon Cozens wrote: I would have thought that a hash element would itself be a PMC rather than an immediate value, so a reference to that should be treated just like any other reference to a PMC. But this does not hold true if the hash

Re: Continuations don't close over register stacks

2004-01-06 Thread Luke Palmer
Jeff Clites writes: On Jan 6, 2004, at 3:41 PM, Luke Palmer wrote: Leopold Toetsch writes: Good. Pass it over to me :) COW copy of stacks and of other buffer-based items is still broken. These need distinct headers so that they work like COWed strings. Alright, I've got a pretty big

Re: Roles and Mix-ins?

2004-01-06 Thread Luke Palmer
Joe Gottman writes: - Original Message - From: Luke Palmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 4:51 AM Subject: [perl] Re: Roles and Mix-ins? David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat

Re: how do I instantiate? -- was: Objects!

2004-01-07 Thread Luke Palmer
Michal Wallace writes: On Tue, 2 Dec 2003, Dan Sugalski wrote: *) Creating new objects involves calling the -init vtable entry *on the class*. Because of this each class gets a custom vtable where the init method has been swapped out for one (from objects.c) that creates a new object

Re: Continuations don't close over register stacks

2004-01-07 Thread Luke Palmer
Leopold Toetsch writes: Jeff Clites [EMAIL PROTECTED] wrote: On Jan 7, 2004, at 1:46 AM, Leopold Toetsch wrote: That part is already answered: create a buffer_like structure. *But* again register backing stacks are *not* in the interpreter context. I don't understand what you are

Re: how do I instantiate? -- was: Objects!

2004-01-07 Thread Luke Palmer
Michal Wallace writes: On Wed, 7 Jan 2004, Luke Palmer wrote: Should go something like this: .sub _main .local object Cat .local object felix newclass Cat, Cat find_type $I0, Cat felix = new $I0 # ... .end Thanks

Re: Continuations don't close over register stacks

2004-01-07 Thread Luke Palmer
Melvin Smith writes: The downside to our implementation is in the return continuation case. The common case is to create the continuation that you plan to return with, and you already know there will be no need for copy-on-write in most cases because typically the execution path will return

Re: [PATCH] The Return of the Priority DOD

2004-01-07 Thread Luke Palmer
Leopold Toetsch writes: Luke Palmer [EMAIL PROTECTED] wrote: After many months of lying dormant, I figured I'd get my act together and adapt this patch to the few recent modifications. And this time, I'm posting a benchmark! Wow, thanks. Some comments

Re: Archive tarball?

2004-01-08 Thread Luke Palmer
michael.firestone writes: Is there somewhere I can get the entire perl6-language archive in a tarball? I personally don't know, but there could be somewhere. I am trying to work on turning the Apocalypses into story cards at http://p6stories.kwiki.org. It would be helpful to me if I

Re: [PATCH] Continuations now close over register stacks

2004-01-08 Thread Luke Palmer
Michal Wallace writes: Luke Palmer wrote: This patch re-implements the register backing stacks as PObjs (so they can be garbage-collected), honors their COW flags, and adds them to the interpreter context (where they should be, honest!). As a healthy side-effect, it encapsulates

Re: [PATCH] Continuations now close over register stacks

2004-01-09 Thread Luke Palmer
Michal Wallace writes: On Thu, 8 Jan 2004, Luke Palmer wrote: .sub __main__ newsub $P0, .Closure, _func savetop newsub $P0, .Continuation, done So the restoretop after the invoke has something to pop (and so your register state isn't screwed up when you get back

Re: BUG: coroutine + exception = stack_height segfault

2004-01-09 Thread Luke Palmer
Jeff Clites writes: On Jan 9, 2004, at 12:24 AM, Leopold Toetsch wrote: Michal Wallace [EMAIL PROTECTED] wrote: #!/bin/env parrot # # yieldbug.imc # # This program should print dots forever. # Instead it prints a few dots and then segfaults. It does print dots forever here. It does

Re: [PATCH] The Return of the Priority DOD

2004-01-09 Thread Luke Palmer
Leopold Toetsch writes: Luke Palmer [EMAIL PROTECTED] wrote: ... I'm not against somebody else maintaining the patch in the meantime :-) I went again through the patch and the original one from Sept, 5th. But it seems that one thing is missing in both: *If* all PMCs which

[PATCH] bug in clear_live_bits

2004-01-10 Thread Luke Palmer
sweep 0 was making parrot segfault for me. The patch explains why. Luke Index: src/dod.c === RCS file: /cvs/public/parrot/src/dod.c,v retrieving revision 1.81 diff -u -r1.81 dod.c --- src/dod.c 10 Jan 2004 19:43:06 -

Contextual calls

2004-01-11 Thread Luke Palmer
I was uneasy when the Cnum_eq and Cstr_eq vtable entries were first proposed. Sure, they get the job done for Perl 5, but Perl 6 is expanding its notion of context beyond those compiled in. You're supposed to be able to add, say, nontransitive ring context if you want. There needs to be a way

Re: PMC template generator. Perl 5 task

2004-01-12 Thread Luke Palmer
Dan Sugalski writes: Okay, here's a task for the perl 5 proficient. I may have mentioned this before, but maybe not. What we need, or at least could really use, is a script that automatically generates missing vtable methods for PMCs. Not defaulting, the way we have now, but actual real

[PATCH] Small register stack fix

2004-01-12 Thread Luke Palmer
This fixes a rather obvious and silly oversight in my patch. Luke Index: src/register.c === RCS file: /cvs/public/parrot/src/register.c,v retrieving revision 1.35 diff -u -r1.35 register.c --- src/register.c 12 Jan 2004

[PATCH] new_noinit and init ops

2004-01-12 Thread Luke Palmer
I have somewhat a predicament. I want to create a continuation, and have that continuation stored in the register stack that it closes over (this is how I'm implementing a loop with continuations). Unless I'm having a major braino, I don't think this is possible at the moment. I got around this

Re: [PATCH] new_noinit and init ops

2004-01-12 Thread Luke Palmer
Luke Palmer writes: ... goto NEXT(); @@ -84,6 +90,19 @@ $1-vtable-init_pmc_props(interpreter, $1, $3, $4); goto NEXT(); } +# } ^ Don't mind that. I thought I saw an extra one, and commented it out to make sure I wasn't being stupid. Wasn't, and forgot to uncomment

Re: [PATCH] Small register stack fix

2004-01-12 Thread Luke Palmer
Dan Sugalski writes: At 10:09 PM +0100 1/12/04, Leopold Toetsch wrote: Luke Palmer [EMAIL PROTECTED] wrote: This fixes a rather obvious and silly oversight in my patch. +PObj_COW_CLEAR((PObj*)buf); I don't think that works or better let's say: it's ok 50 percent - for the new buf

Re: [PATCH] new_noinit and init ops

2004-01-12 Thread Luke Palmer
Michal Wallace writes: On Mon, 12 Jan 2004, Luke Palmer wrote: I have somewhat a predicament. I want to create a continuation, and have that continuation stored in the register stack that it closes over (this is how I'm implementing a loop with continuations). Unless I'm having a major

Re: [PATCH] new_noinit and init ops

2004-01-12 Thread Luke Palmer
Michal Wallace writes: On Mon, 12 Jan 2004, Luke Palmer wrote: Michal Wallace writes: On Mon, 12 Jan 2004, Luke Palmer wrote: I have somewhat a predicament. I want to create a continuation, and have that continuation stored in the register stack that it closes over

[PATCH] Updatecc fix

2004-01-13 Thread Luke Palmer
In the spirit of getting real continuations working Just Right, this modifies IMCC's PCC implementation to emit the updatecc *after* the pushtop, so that the redundant pushtop isn't necessary when returning with a real continuation. I'm also thinking that updatecc should cow_copy_context, not

Re: run-once code

2004-01-13 Thread Luke Palmer
David Storrs writes: Given this code: if ( some_expensive_lookup_function() = $MAX_RECORDS ) { mark_that_we_have_reached_max_records(); return; } After I enter that block once, I never want to evaluate the condition again--I want the code to completely

Re: run-once code

2004-01-14 Thread Luke Palmer
Jonathan Scott Duff writes: On Tue, Jan 13, 2004 at 10:16:48PM -0700, Luke Palmer wrote: So, let's say you have something like: $x = 100_000; my $seen; while $x -- 0 { Don't do that! I had to look at this twice before I decided that perl6 didn't get a new operator

<    4   5   6   7   8   9   10   11   12   13   >