Seems like this is the kind of thing that needs to have a common subroutine
in the C source so it can be used elsewhere, and an opcode so it's usable
with an S register. And once you've done that, the METHOD becomes redundant.
--
Chip Salzenberg <ch...@pobox.com>
say $S0
works just fine.
I don't think there's *a priori* a problem to implicitly upgrade
something to a PMC to perform a non JIT-able task on it. I do think
pulling too hard at this thread might require a closer look at what's
current in src/pmc/ vs. src/*.c vs src/ops/ (where's there's
smoke...): a lot of the current state has been a result of organic
(rather than planned) growth.
Regards.
--
Will "Coke" Coleda
wi...@coleda.com
forcing me to convert the int to a string in order to auto-print a
newline instead of printing the int and the newline separately saves
me no code. having an op that's named the same as a parrot op but is
limited to one register type is confusing.
/flame off
~jerry
Well, 'say' is a parrotio METHOD, not a String METHOD:
METHOD INTVAL say(STRING *s)
so the SELF is an io PMC and nothing is hard. Expressing to_int() as a
method where the SELF is a String PMC leaves the string registers out in the
cold.
The 'say' opcode also requires hackery in src/builtin.c; but since "requires
hackery" seems to be the status quo ante for half of Parrot, perhaps I should
let that go unmentiond. Oops, too late. ("Bitter? Oh, a *tad*.")
> I do think pulling too hard at this thread might require a closer look at
> what's current in src/pmc/ vs. src/*.c vs src/ops/ (where's there's
> smoke...): a lot of the current state has been a result of organic (rather
> than planned) growth.
No kidding. :-/
--
Chip Salzenberg <ch...@pobox.com>
Agreed.
> On Fri, Aug 25, 2006 at 03:32:12PM -0400, Will Coleda wrote:
>> I do think pulling too hard at this thread might require a closer look at
>> what's current in src/pmc/ vs. src/*.c vs src/ops/ (where's there's
>> smoke...): a lot of the current state has been a result of organic
(rather
>> than planned) growth.
Overall, this sounds like an excellent addition to the coding standards,
and an excellent task for the cage cleaners.
Allison