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
--- Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> TOGoS <[EMAIL PROTECTED]> wrote:
>
> > --- Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> >> TOGoS wrote:
> >>
> >> > Why not extend this to properties, too?
> >>
>
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
> 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
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
> 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
> >
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
--- 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
> 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
> > 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
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
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
--- 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
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
--- 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
> 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
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
> 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
> 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.
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()
> 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
--- Piers Cawley <[EMAIL PROTECTED]> wrote:
> Leopold Toetsch <[EMAIL PROTECTED]> writes:
>
> > Togos <[EMAIL PROTECTED]> wrote:
> >
> >> $I1 = $I2 + $I3
> >
> >> $P1 = $P2 + $P3
> >
> >> Which, of course, doesn
--- 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
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
> 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
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)
> >> 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
> 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
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
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
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
> 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
> 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
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
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
--- 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
> 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
> > #
&
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
___
--- 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 #
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
> > 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
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:
--- 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
--- 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/
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
> 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
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
--- 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
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
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
> > 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
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
> 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)
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
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
--- 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
56 matches
Mail list logo