Re: [perl #30908] [PATCH] find_or_create_global

2005-10-03 Thread TOGoS
I think that was taken care of by adding the addition of a 'don't throw exception on undefined global access' runtime flag. Though find_or_create_global might still be useful, I don't think it's worth digging up that old patch. --- Joshua Hoblitt via RT <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTE

Re: Keys

2005-06-01 Thread TOGoS
--- Leopold Toetsch <[EMAIL PROTECTED]> wrote: > TOGoS <[EMAIL PROTECTED]> wrote: > > > --- Leopold Toetsch <[EMAIL PROTECTED]> wrote: > >> TOGoS wrote: > >> > >> > Why not extend this to properties, too? > >> >

Re: Keys

2005-06-01 Thread TOGoS
perl6-internals: the place to go to have people tell you things you already know and not actually answer your question at all. --- Leopold Toetsch <[EMAIL PROTECTED]> wrote: > TOGoS wrote: > > > Why not extend this to properties, too? > > > foo.hello be

re: Keys

2005-05-31 Thread TOGoS
> The 'used as' type indicates whether this key > is to be used to do a by-integer-index (array) > access or by-string-index (hash) access. Why not extend this to properties, too? foo['hello'] becomes 'hello' string as-offset foo{'hello'} becomes 'hello' string

Re: Namespaces again

2004-09-30 Thread TOGoS
No no no. You've all got it all wrong. Except for the Dans. :) > Namespaces are going to be *simple*. > They do two things, and only two things. > > 1) They provide a hierarchy for other namespaces > 2) They bind names to PMCs And that's all good. Here's what Perl can do: $foo becomes namespace

Re: Namespaces again

2004-09-28 Thread TOGoS
> According to TOGoS: > > Chip said: > > > A Perl runtime won't have the > > > necessary information > > > to present [a unified namespace]. > > > > I'm not so sure about that. Most of the time, > > only one variable with > >

Re: Namespaces again

2004-09-28 Thread TOGoS
Chip said: > ...the "appearance" of a unified namespace *is* > a unified namespace. Yup. > A Perl runtime won't have the necessary information > to present one. I'm not so sure about that. Most of the time, only one variable with a name will be defined ($foo, @foo, or &foo, but not more than one

Re: Namespaces again

2004-09-28 Thread TOGoS
--- Chip Salzenberg <[EMAIL PROTECTED]> wrote: > According to TOGoS: > > Each namespace should have a > lowest-common-denominator set of values > > in it. These are not specified to be functions, > namespaces, or > > whatever. They're just pointers to val

Re: Namespaces again

2004-09-28 Thread TOGoS
> And unfortunately dies a horrible death for languages > that don't categorize the same way as perl. :( As > well as being really inconvenient for those variables > that can express multiple classes of behaviours > simultaneously. > > This one, alas, I'm going to shoot down. > - Dan OK, I'm going

Re: Namespaces, part 1 (new bits)

2004-09-25 Thread TOGoS
> > I think Guido might have made things a > > bit harder to separate out than you > > anticipate, unless I misread you. It > > appears that modules and classes are > > also imported into the same namespace > > as everything else in python. > > Yeah, I had that pointed out in private > mail. At thi

Re: A new language using Parrot: Span 0.1

2004-07-31 Thread TOGoS
This is definitely cool. I'm impressed :) Your PBC output code seems a little buggy, tho ;) error:imcc:main: Couldn't open /tmpo.pbc/Hpbco.spa But keep up the good work. A compiler writer myself, I'd like to know more about how others go about implementing these things. I'm eagerly awaiting th

find_or_create_global

2004-07-31 Thread TOGoS
Whenever I assign a value to a global variable, my compiler has to output code such as: find_global $P0, "thingy" setref $P0, something store_global "thingy", $P0 This is because it doesn't know if the global 'thingy' al;ready exists, and if it doesn't, the Undef that find_global returns wo

Re: Quick thing for the piethon interested

2004-07-16 Thread TOGoS
--- TOGoS <[EMAIL PROTECTED]> wrote: > This is my first code patch EVAR, so here's to > hoping I didn't mess it all up. Seems to work, anyway. >:# Sorry. Did the diff wrong. Here it is, the right way. __ Do you

Re: Quick thing for the piethon interested

2004-07-16 Thread TOGoS
This is my first code patch EVAR, so here's to hoping I didn't mess it all up. Seems to work, anyway. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail python.ops-2004.07.16.diff De

Re: PerlHash using PMCs for keys?

2004-06-04 Thread TOGoS
--- Piers Cawley <[EMAIL PROTECTED]> wrote: > new P10, .PerlHash > new P1, .PerlString > set P1, "Bar" > new P2, .Key > set P2, P1 Oops! should be assign! This is one of the reasons I think code like $P0 = new PerlString $P0 = "foo" should be illegal. If people were forc

Re: compiler-faq

2004-05-30 Thread TOGoS
> Your answer is about compiling a subroutine that > does something. What's wrong with the current wording: > > How do I generate a sub call with a > variable-length parameter list in PIR? > > Use unprototyped calls and functions and pass > as many arguments as you have. Well, for

PerlHash using PMCs for keys?

2004-05-20 Thread TOGoS
Should aggregate PMCs (like PerlHash) be able to take PMCs as keys? I mean so that: $P0 = $P1[$P2] where $P1 is a PerlHash, would work. The way it works now is that it complains that you can't use a PMC as a key. So my compiler has to spit out about 20 lines of code for every sub-element access

Re: Non-flow-control logical tests

2004-05-20 Thread TOGoS
> Anyway, because of it I'm pondering > non-flowcontrol logical ops. Those would be very nice for us compiler-writers. It's a bit (heh) late for me to bring this up, now, but I always thought the flow-control ops should be prefixed with 'j' or something. Like in most other assemblies. You have "j

Re: IMCC bug?

2004-05-09 Thread TOGoS
> Global subroutine labels have to begin with an > underscore. Oh, yeah. Now I remember :P > It shouldn't segfault though, but produce > some kind of error. Each time I did this, it produced run-time errors. Never said 'invalid symbol' or anything. It would be nice if it had.

IMCC bug?

2004-05-08 Thread TOGoS
OK, when I compile this code to PASM, then execute it, it works just fine (prints "i like peanuts", "hello", then "goodbye"). But if I call parrot directly on the IMCC code, it gives me a segmentation fault after printing "i like peanuts". .sub looper print "i like peanuts\n" shooper()

Re: Joys of assignment

2004-04-26 Thread TOGoS
> Okay, I've skimped on the explanations > (I thought they were obvious, but that's > just not true), so it's time to get things > down. w007, w00t. That is correct. :) > (And yes, this means store_global > will be relatively little-used) Would a few operators like 'find_or_store_reference_glob

Re: Behaviour of PMCs on assignment

2004-04-07 Thread TOGoS
--- Piers Cawley <[EMAIL PROTECTED]> wrote: > Leopold Toetsch <[EMAIL PROTECTED]> writes: > > > Togos <[EMAIL PROTECTED]> wrote: > > > >> $I1 = $I2 + $I3 > > > >> $P1 = $P2 + $P3 > > > >> Which, of course, doesn

Re: Behaviour of PMCs on assignment

2004-04-01 Thread TOGoS
--- Dan Sugalski <[EMAIL PROTECTED]> wrote: > >we Ruby folks would like to be able to do: > > > > $P1 = $P2 + $P3 > > > >Which, of course, doesn't work. > > Well... actually you don't want what you're asking > for. Maybe... :/ > Specifically you don't want > > foo = bar + baz > > to acc

Re: Behaviour of PMCs on assignment

2004-03-29 Thread TOGoS
r of pmc1.value = pmc2 + pmc3 And if the latter behavior is common enough, then it should have its own instruction. 'content_add' or something. Same goes for the other PMC modifying ops. - TOGoS __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html

Re: Behaviour of PMCs on assignment

2004-03-29 Thread TOGoS
> This has come up before and the discussion > always semi-warnocks, but Yeah... > 1) Have a version of the binary vtable >methods that create the destination PMC > 2) Make a universal assignment PMC that >takes on the characteristics >of the RHS of the assignment > 3) Have a "this

Re: Behaviour of PMCs on assignment

2004-03-27 Thread TOGoS
Ergh. Once agian, sorry if this shows up twice. If someone can tell me a way to be subscribed to the list without actually getting every message (I prefer to read from the archive), that'd be great. Anyway... > This has come up before and the discussion > always semi-warnocks, but Yeah... > 1)

Re: Dates and Times

2004-03-04 Thread TOGoS
> >> Interesting -- so the planet's finally gotten > >> its act together and settled on a rotational > >> speed, huh? Cool. :) > > > >Nobody said anything about a planet. > > Actually, they did. UTC (which was the original > reference) is defined such that noon is within .9 > seconds of the sun

Re: Dates and Times

2004-03-04 Thread TOGoS
> Interesting -- so the planet's finally gotten > its act together and settled on a rotational > speed, huh? Cool. :) Nobody said anything about a planet. A clock should tell you how much time has gone by. If I get a time, sleep(1), and get another time, time 2 should be about time1 + 1 second, re

New Parrot-targetting language: ConfigScript3

2004-02-16 Thread TOGoS
ConfigScript3 uses a custom OO AST between the parser and the IMCC outputter called "GenScript3", which I plan to write more front-ends (Ruby?) and back-ends (Jasm?) for. I hope you like it, and I hope this was the right place to post this :) - TOGoS (http://tog

Re: Rules for method resolution?

2004-02-16 Thread TOGoS
Dunno why it is, but I tried to post a message about 30 hours ago and nothing ever showed up in the NNTP archive. So I re-subscribed again figuring that'd speed things up. You should see my perl box: ... WELCOME to [EMAIL PROTECTED] confirm subscribe to [EMAIL PROTECTED] GOODBYE from [EMAI

question about global labels in imcc

2004-01-19 Thread TOGoS
ncy): " print $I1 print "\n" exit 0 .end .sub _main2 _baz: exit 0 .end outputs _baz: -1 _baz (fancy): 136929824 Is there any way I can get that magic without having to actually create a new .Sub object? thanks, - TOGoS __ Do yo

Re: What the heck is active data?

2003-08-27 Thread TOGoS
> Most objects in Parrot will be dealt with by > reference, which is to say > that the PMC that a name is bound to is not an > object, but rather a > reference PMC that points to the object PMC. An > assign, in that case, just > copies the value in the source reference (which is > the pointer to th

Re: What the heck is active data?

2003-08-27 Thread TOGoS
> The part that affects us is that we can't tell at > compiletime whether > assignment is rebinding or is a get/set, because we > could have code > like: > > kitchentemp = new('kitchenroom'); > bedroomtemp = new('bedroom'); > bedroomtemp = kitchentemp; > > > which is typeless, a

Method call parameters

2003-08-24 Thread TOGoS
What's the reasoning behind putting the object a method is being called on in P2 instead of in the first parameter of the method? I have a feeling that putting it as the first parameter of the method would make the lives of the python folks a little bit easier. Would it make it harder for someone e

Re: Set vs. Assign..?

2003-08-22 Thread TOGoS
I sent something similar to this about 6 hours ago but it never showed up so I think it got spam filtered or something. <:-/ Anyway, just to clear things up, here is my take on 'set' and 'assign': set: replace the reference in the destination register assign: don't change the reference in the

Re: Calling parrot from C?

2003-08-15 Thread TOGoS
--- Sean O'Rourke <[EMAIL PROTECTED]> wrote: > Luke Palmer <[EMAIL PROTECTED]> > writes: > > > How does one call a parrot Sub from > > C and get the > > I'd vote for stuffing args into the > interpreter, calling the sub's invoke() > method, then digging through the registers > to pull out the ret

Re: set vs. assign, continued: 'add' vs. 'add!'

2003-08-15 Thread TOGoS
> Brent Dax wrote: > > TOGoS: > > # When I say in IMCC: > > # > > # $P0 = $P1 + $P2 > > # > > # , I expect it to create a new value and > > # store it in > > # $P0, not give me a segfault because I didn't say > > # &

pcc_return problem

2003-08-14 Thread TOGoS
reason I'm not supposed to have more than one pcc_return in a compilation unit (in which case how am I *supposed* to implement something like if foo { return "bar" } else { return "quux" } )? Or was this just an oversight by the IMCC implementors? - TOGoS ___

RE: set vs. assign, continued: 'add' vs. 'add!'

2003-08-14 Thread TOGoS
--- Brent Dax <[EMAIL PROTECTED]> wrote: > TOGoS: > # When I say in IMCC: > # > # $P0 = $P1 + $P2 > # > # , I expect it to create a new value and store it > in > # $P0, not give me a segfault because I didn't say > # > # $P0 = new #

Re: calling conventions, variable-length parameter lists

2003-08-14 Thread TOGoS
Luke said: > > sub ($param1, [EMAIL PROTECTED]) > > In which case, if it's prototyped, we stuff > everything besides the > first parameter into a PMC representing > @otherparams. > > And if you meant something else, can't help ya. > > Luke Maybe I misunderstand what 'prototyped' means. I as

Re: calling conventions, variable-length parameter lists

2003-08-14 Thread TOGoS
> > Unprototyped :-) I guess I didn't make that quite > > clear, enough. > > Setup a param array, that's all. > > leo Umm... OK. Here's what I've done: I created 2 functions that I can use when dealing with variable-length parameter lists. One to turn an array into pcc-compliant parameters, and on

RE: set vs. assign, continued: 'add' vs. 'add!'

2003-08-14 Thread TOGoS
uot;="), but we can also go into the back room and alter the values referenced by tickets (we call this "assign", and TOGoS suggests that we have a "<-" operator for it) So you can't _assign_ a value to an integer, as there is not actually anything in the back room:

Re: calling conventions, variable-length parameter lists

2003-08-14 Thread TOGoS
--- TOGoS <[EMAIL PROTECTED]> wrote: > > Leopold Toetsch wrote: > > TOGoS wrote: > >>>> Unprototyped :-) I guess I didn't make that > >>>> quite clear, enough. > >>> > >>> Setup a param array, that's all. > &g

Re: call and return conventions

2003-08-14 Thread TOGoS
--- Luke Palmer <[EMAIL PROTECTED]> wrote: > TOGoS writes: > > I0 Prototyped return? > > I1 Number of overflow return values > > I2 Number of return values in PMC registers > > P3 Overflow return values in an array PMC > > > > so as to make call/

set vs. assign, continued: 'add' vs. 'add!'

2003-08-14 Thread TOGoS
add(out INT, in INT, in INT) add(out NUM, in NUM, in INT) add(out NUM, in NUM, in NUM) add(in PMC, in PMC, in INT) add(in PMC, in PMC, in NUM) add(in PMC, in PMC, in PMC) This kind of ties into the 'set vs assign' issue. Add behaves differently depending on whether the first parameter is an intege

Re: assign opcodes

2003-08-14 Thread TOGoS
> Out of curiosity, how does the word > "assign" imply that it morphs an > existing value, and how does the word > "set" imply that it copies a pointer? Well, I suppose "set" was chosen just because that seems to be the standard name for an operation that copies a pointer. Then "assign" was chosen

Re: calling conventions, variable-length parameter lists

2003-08-14 Thread TOGoS
Leopold Toetsch wrote: > TOGoS wrote: >>>> Unprototyped :-) I guess I didn't make that >>>> quite clear, enough. >>> >>> Setup a param array, that's all. >>> >>> leo >> Umm... OK. Here's what I've done: I c

RE: pirate status / need help with instances

2003-08-14 Thread TOGoS
--- Brent Dax <[EMAIL PROTECTED]> wrote: > Sean O'Rourke: > # >* make parrotclass handle "invoke" > # > this strikes me as the most efficient, > # > but I'm not really confident with C > # > so I'm hesitant to try it > # > # This seems to me like the way to go, > # except you m

calling conventions, variable-length parameter lists

2003-08-14 Thread TOGoS
I want to be able to have a function with this kind of signature: func ($param1, *$otherparams) AFAIK, there is no way to implement this with the current calling conventions. You would have to do something with variable register IDs, which we don't have and which would probably be a bad idea, any

call and return conventions

2003-08-14 Thread TOGoS
According to the PDD03 I have here: Calling conventions: I0 Prototyped call? I1 Number of overflow params I2 Number of params in PMC registers P3 Overflow params Return conventions: I0 Prototyped return? I1 Number of return values in integer registers I2 Number of return values in string r

Re: Set vs. Assign..?

2003-08-10 Thread TOGoS
> > PieThonInt, RubyInt? > > Hmm. I that parrot should DTRT, and use > CurrentLanguageInt. :) Hmm. I agree with Leo, here. P6 = new PerlInt (3) would be equivalent to PASM: new P6, PerlInt assign P6, 3 This is more generic and would be portable to any kind of PMC you want. Arrays, Stri

IMCC hangs

2003-08-10 Thread TOGoS
This code causes IMCC to hang: .pcc_sub _main non_prototyped newsub $P5, .Sub, _ags_3 $P4 = new PerlString $P4 = "foobar!" newsub P1, .Continuation, agl_1 .pcc_begin non_prototyped .arg $P4 .pcc_call $P5, P1 agl_1: .result $P6 .pcc_end end .end

Re: assign opcodes

2003-08-10 Thread TOGoS
> Anyway: > > assign Px, {Iy,Sy,Ny} > > are not needed IMHO, these end up as > set__native and are identical > to set Px, {Iy,Sy,Ny}. Yes, but as we were discussing in the Set vs. Assign thread, it makes more sense to call them 'assign', as it morphs the existing value (as 'assign Px, Py' does)

Re: calling conventions, variable-length parameter lists

2003-08-09 Thread TOGoS
Luke said: > Plus, parameters to functions are likely to be used > in the code of the > function (and likewise with return values), so we're > just skipping > unloading the array into registers. OK. That makes sense, but my problem is: in the case that the called function *does* treat its paramete

Re: Set vs. Assign..?

2003-08-07 Thread TOGoS
error.) > > But the set_s_ic op doesn't do an assign. > > S0 = "Hello" > S1 = S0 > S1 = 23 > print S0 > > Prints "Hello". Bah. OK. Thanks for clearing that up :-) - TOGoS __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

Re: Set vs. Assign..?

2003-08-04 Thread TOGoS
--- Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 11:45 AM -0700 8/1/03, TOGoS wrote: > > ...blah, blah, blah... > > > > What I don't like about this is > > that it's not immediately obvious > > from looking at the code whether > > you're